I have a request that returns a json body which I only want to capture one of two objects. I want to count the number of occurrences for the membershipId:32041428 below, not number of occurrences for the second mebershipId: 8315319241
earlier this worked fine (
.check(jsonPath("$.membershipCoupons[*].coupons[?(@.activationDate==null)].offerId").findAll.optional.saveAs("itemList"))
but now the responses could contain more than one membership, and I only want to capture the number of offerids for the mebershipId I parameterize with my .csv with column ${medlem}
`
{
“resultCode”: “SUCCESS”,
“errorCode”: null,
“errorMessage”: null,
“membershipCoupons”:
[
{
“membershipId”: “32041428”,
“coupons”:
[
{
“offerId”: “000C291EE9241ED4AAF45058D8564910”,
“description”: “merchant1”,
“graphics”:
[
{
“width”: 400,
“height”: 200,
“quality”: “Low”,
“url”: “https://site/02_201506_011/000C291EE8241ED4AAF43058D8564910Low.jpg”
},
{
“width”: 900,
“height”: 600,
“quality”: “High”,
“url”: “https://site/02_201506_011/000C291EE8241ED4AAF43058D8564910High.jpg”
}
],
“endTime”: 1423353600000,
“activationDate”: 1423579699407,
“redemption”: null
},
]
},
{
“membershipId”: “8315319241”,
“coupons”:
[
{
“offerId”: “000C291EE8241ED4AAF43058D85CA910”,
“description”: “merchant2”,
“graphics”:
[
{
“width”: 400,
“height”: 200,
“quality”: “Low”,
“url”: “https://site/02_201506_011/000C291EE8241ED4AAF43058D85CA910Low.jpg”
},
{
“width”: 900,
“height”: 600,
“quality”: “High”,
“url”: “https://site/02_201506_011/000C291EE8241ED4AAF43058D85CA910High.jpg”
}
]
}
]
}
`
I tried to put the parameter for the ‘in-session’ member like this: