Steps I am trying to achieve in my gatling request:
1. Hit a request in a loop.
2. Save the value of 'status' from JSON response into 'respStatus'
3. Set 'respStatus' into a session variable 'workStatus'
4. Recursively check for the value of session variable 'workStatus' and exit when its value is changes from creating to anything else.
Here is my code. This one below stops the execution after 1st iteration of this request , checking the response body shows that the value of 'creating' in JSON response did not change at the point when it stopped. What is wrong with the code or is there any alternate to achieve this?
.doWhile(session => !session(workStatus).as[String].equal("creating"),"index"){
exec(http("Request1")
.get(<URL goes here>)
.header(<Headers in a map>)
.check(jsonPath("$..status").saveAs("respStatus")))
.exec(session => session.set("workStatus","${respStatus}"))
.pause(10)
}.pause(10)