I have a JSON File feeder which has JSON that is nested like:
{ "id": "X", "context": { "id": "Y" }, "username": "Z" }
And I can successfully access the id and username in my Karate file using: #(__gatling.id) etc. However, when I try and access #(__gatling.context.id) it comes up null.
id
username
#(__gatling.id)
#(__gatling.context.id)
null
Gatling has obviously parsed it into a Map but I'm unclear now how to access this variable?
I don't know how you are setting up the feeder data. Here is the example in the docs: https://github.com/intuit/karate/tree/master/karate-gatling#feeders
val feeder = Iterator.continually(Map("someKey" -> "someValue"))
And then #(__gatling.someKey) would work. So try the Map (JSON) like this and it should work. And please use the new 1.0 RC stream as this is going to be released soon: https://github.com/intuit/karate/wiki/1.0-upgrade-guide
#(__gatling.someKey)
If it still doesn't work, please follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
1.4m articles
1.4m replys
5 comments
57.0k users