The requirement is we have to identify "elements" and then check if its true or false.
{
"first": {
"second": [
{
"element": 1,
"elementrec": null,
"enabled": true,
"rec": null
},
{
"element": 2,
"elementrec": null,
"enabled": false,
"rec": null
},
{
"element": 3,
"elementrec": [
"3"
],
"enabled": true,
"rec": [
"3"
]
}
}
]
}
}
Above 3 element has either true or false. Would like to identify all 3 elements for true or false using different json assertion.
I don't know what do you mean by "identify", there are too many possible options so I'll come up with the shortest one:
Add JSR223 PostProcessor as a child of the request which returns the above JSON
Put the following code into "Script" area
Run your test
In jmeter.log file you will see "elements" with their "enabled" status
Demo:
More information: