I tried but I have some condition to failed the scenario, and I cannot figure out how to do it.
here is an example, THE CHECK ARE NOT REAL CODE, but rather a way to explains my different conditions
.check(jsonPath("""$.taskId""").ofType[String].saveAs(“taskId”)) // get the task id of the backend background task
.tryMax(300) { // try max 5 minutes
exec(
http.get(get taskId status) // call http to a webservice to get a json
.check(jsonPath("""$.finalStatus""").ofType[String].is(“Done”)) >> should exit the tryMax block and continue the
.check(jsonPath("""$.finalStatus""").ofType[String].is(“Error”)) >> should exit the tryMax block and failed the scenario
.check(jsonPath("""$.finalStatus""").ofType[String].is(“In progress”)) >> should continue the tryMax block