Repeat a test step until desired property value is in the response
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.
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.
I think i can help, but im typing this out on my phone right now. I'll respond when im back in my house tomorrow when i have my laptop....unless one of the coders (@HimanshuTayal, @nmrao, @ChrisA) answers this first as i've seen them answer this if/then/else issue before now (and my groovy is rubbish!)
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
No more workaround to support you since I did not get anything from your attachment. I attached groovy script that is groovy GDK built-in package, no need other dependency. So you should not run into those weird issue.
Can you please paste more details if possible? Maybe community would help you figure it out.
I did not login community all the time as I have a new project to work on now. Whatever, will go through all of new update and try to answer questions if I can.