Repeat a test step until desired property value is in the response
Hi,
I'm tryin to build a new test step for my API testing, but I don't get the desired result.
Below you can see the JSON data from my REST response. So the goal here is to make sure that e.g. at 15pm when the test runs, the JSON response would be checked for the right "reasonCode". In my case it is "EM_004". The response is not always there right on time at 15pm, so that's why I think I need some kind of a loop so I can check for a period of 5 minutes or something like that if the right "reasonCode" is already there. So as soon as the right "reasonCode" is received the loop should stop and the test case should go on.
{
"id" : "data",
"title" : "data",
"reasonCode" : "EM_005",
"publishedAt" : "data",
"reference" : {
"productType" : "data",
"deliveryDate" : "data",
}
},
{
"id" : "data",
"title" : "data",
"reasonCode" : "EM_004",
"publishedAt" : "data",
"reference" : {
"productType" : "data",
"deliveryDate" : "data",
}
},
{
"id" : "data",
"title" : "data",
"reasonCode" : "EM_002",
"publishedAt" : "data",
"reference" : {
"productType" : "data",
"deliveryDate" : "data",
}
}
Unfortunately I'm a total noob at groovy-scripting and stuff like that so it would be very cool if you could help me out here. If there are any further question just write me a pm or direct response, please.
Thanks a lot in advance,
4nes team