I want to hit an get API by putting in for loop because in the first hit I wont get entire response. I want to keep on hitting the API continuously and check if expected value contains in the response or not. My expected value may come at 2nd hit or it may come at 4th hit. I cant use hard delay I want to put it in loop and check if my expected value comes in response then I will exit the loop.
Asked
Active
Viewed 161 times
1 Answers
0
This is exactly what retry until
is for. Please read the docs: https://github.com/intuit/karate#retry-until
Since this may be tricky if you are very new to Karate, refer this answer also: https://stackoverflow.com/a/55823180/143475

Peter Thomas
- 54,465
- 21
- 84
- 248
-
Thanks for quick response peter. How to add * configure retry = { count: 10, interval: 5000 } in karate-config.js. – Sivaji Cheni Mar 01 '20 at 06:40
-
@SivajiCheni `karate.configure('retry', { count: 10, interval: 5000 });` – Peter Thomas Mar 01 '20 at 06:42
-
@SivajiCheni ask a new question please or follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue default retry config should at least work without anything in karate-config.js – Peter Thomas Mar 01 '20 at 06:49
-
Ok Thank you @Peter Thomas – Sivaji Cheni Mar 01 '20 at 06:53