Hi,
As per our requirement we need to wait either REST API response as “Completed” or 6 iterations of that call. Below is our Gatling script.
//.asLongAs((session => session(“counter”).as[Int] < 7 || session(“Status”).as[String] != “Completed”), “counter”)
//.asLongAs((session => session(“Status”).as[String] != “Completed”), “counter”)
//.asLongAs((session => session(“counter”).as[Int] < 7 ), “counter”)
{
group(“Check Status”)
{
exec(http(“request_17”)
.get("""/api/jobs/id""")
.headers(headers_0)
.check(jsonPath("$.status").dontValidate.saveAs(“Status”) )
).pause(5)
//counter = counter.intValue() + 1
} }
If we combined both above condition with OR, it goes in infinte loop; However both this condition works individually. I am not sure what is wrong in combined condition.
Thanks,
Chetan