In JMeter I want to check the number of objects in a JSON array, which I receive from the server.
For example, on a certain request I expect an array with 5 objects.
After reading this: count members with jsonpath?, I tried using the following JSON Path Assertion:
- JSON Path: $
- Expected value: hasSize(5)
- Validate against expected value = checked
However, this doesn't seem to work properly. When I actually do receive 5 objects in the array, the response assertion says it doesn't match.
What am I doing wrong?
Or how else can I do this?