Unanswered question

picking value depend to another correlated value

I want to extract "objname" value according to the randomly selected "objid".

On runtime i want a user to select random object. for that i need to pass "objname" and "objid". so I need to randomly select one "objid " that i can extract from the response along with that i need to extract the "objname"for the "objid " selected by the Neoload

Below the response from the server
{
"text": "Cosmopolitan",
"objid": "4569",
"objname": "Cosmopolitan",
"listDefID": "ESJobDELList",
"createscreenname": "PRJNewJob",
"createtemplate": "Job",
"createtitle": "Create Project",
"iconCls": "customer_folder",
"": "cosmopolitan",
"draggable": false,
"listtemplate": "Customer"
},
{
"text": "Cosmopolitan_cover",
"objid": "4846598",
"objname": "Cosmopolitan_cover",
"listDefID": "ESJobDELList",
"createscreenname": "PRJNewJob",
"createtemplate": "Job",
"createtitle": "Create Project",
"iconCls": "customer_folder",
"": "cosmopolitan_cover",
"draggable": false,
"listtemplate": "Customer"
},
{
"text": "Elle",
"objid": "2834",
"objname": "Elle",
"listDefID": "ESJobDELList",
"createscreenname": "PRJNewJob",
"createtemplate": "Job",
"createtitle": "Create Project",
"iconCls": "customer_folder",
"": "elle",
"draggable": false,
"listtemplate": "Customer"
},

Anoop R.
Anoop R.

Anoop R.

Level
0
1 / 100
point

Answers

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

I can see multiple ways to achieve your goal. For example, if you create your variable extractor using the Advanced mode you could extract all occurrences of both objid and objname at the same time using such regular expression:

"objid": "(.\d*?)",([\s\S]*?)"objname": "(.*?)",

If your variable extractor name is "MyVariable" then you can pick a random objid related to an objname using such variables: ${MyVariable_rand_g1} and ${MyVariable_rand_g3}