jsonPath does not find value in json response body

Good afternoon,

I build this check to get an id from the json response body using jsonpath:


When running the simulation I can see this error message:

request_3: KO jsonPath(/objects/id).exists() didn’t match: found nothing

Json response body is below:


I need to extract “11055” and save it as a session parameter. Any ideas why this is not working?

I am using Gatling 2.

Many thanks,


Before Gatling 1.5 , jsonPath use the XPath syntax, and your expression would have worked back then.
But since Gatling 1.5 (and therefore Gatling 2), we are using the proper JSONPath syntax, which is described here : http://goessner.net/articles/JsonPath/ .
You can use this site if you want to check your expressions : http://jsonpath.curiousconcept.com/

In your case, the correct JSONPath expression would be : $[0].objects[0].id ( this one would work too : $…id )



Hi Pierre,

it worked, thanks do much for your answer!

Kind regards,

Could we get the docs on the gatling github page updated with this information:


(Doesn’t look like the wiki is open for everyone to edit, otherwise I’d have done it myself)

Sure, will do !

There is some info about the JsonPath syntax change in the Changelog, but it’s missing in Checks…

We plan to move away from Github’s wiki for the documentation to a fully-fledged documentation system, which would allow PRs on documentation.



Wiki updated, with a link to syntax documentation: http://goessner.net/articles/JsonPath