Can you please help me with a JMeter Json extractor to extract Random rid with below conditions rid !=0 and Name starts with "Test" For Example: for below json we should retrieve rid 3 or 7 as it is not 0 and Name starts with "Test"
{
"Documents": [
{
"rId": 0,
"Name": "Test_Sunil",
},
{
"rid": 3,
"Name": "Test_Sunil",
},
{
"rid": 7,
"Name": "Test_Kumar",
}
{
"rid": "0",
"Name": "Unknown",
}
]
}
You can go for JSON Extractor and the following JSONPath expression:
$..Documents[?(@.rId != 0 && @.Name=~ /Test.*/)].rid
Full configuration:
Refer extracted value as ${rid}
later on where required.