The json response body is:
{
"status": 11111,
"data": {
"mylist":
{
"1": [
{
"id": 1,
"tId": 11
}],
"2": [
{
"id": 2,
"tId": 12
},
{
"id": 3,
"tId": 12
},
{
"id": 4,
"tId": 13,
}
]
}
Here, I want to get the count of ids present within "2" and not from "1". In above example I want to get idcount=3.
Add JSON Extractor as a child of the request which returns the above response
Configure it as follows:
Textual version of the JSON Path expression just in case: $.data.mylist.2.*.id
You will get the following JMeter Variables (can be visualized using Debug Sampler):
id_1=2
id_2=3
id_3=4
id_matchNr=3
so you will be able to refer this 3
as ${id_matchNr}
where required