How about using while
loop, perform GET
request inside, get the status and put the Thread
to sleep?
String field_name = "start";
while (field_name.equals("start")) {
try {
Thread.sleep(500);
} catch (InterruptedException ignore) {
}
Response response = when().get("my url").then().extract().response();
field_name = response.jsonPath().getString("path.to.field_name");
}
In the above code, I assumed that field_name
is start
.
The loop begins, we wait for 500 milliseconds and after that time, we perform GET
request, extract its response and get the field_name
value.
If the field_name
value equals stop
then the loop will no longer be executed. If the loop equals start
then we wait for another 500 milliseconds, perform GET
, get the status etc...
Hope it helps!