I'm using NeoLoad 6.3.1 at the moment and am trying to get the length of an array where the array itself is the root element.
Given the following sample JSON:
[
{ "id": 1, "title": "Item 1" },
{ "id": 2, "title": "Item 2" },
{ "id": 3, "title": "Item 3" },
{ "id": 4, "title": "Item 4" },
{ "id": 5, "title": "Item 5" }
]
I want to just get back the answer of "5".
If I use the JSON Path Online Evaluator, I can use $.length
and it returns:
[ 5 ]
In NeoLoad 6.3.1, that returns an error.
As NeoLoad is Java-based, I am assuming that they're using the com.jayway.jsonpath's json-path library (or something similar). Based on the documentation there I updated the query to be $.length()
but did not have any luck.
Any suggestions?