0

I can only get it to work for one call at a time. I've looked around quite a bit and haven't found any answers for this specific scenario.

Its a cleanup scenario where I want to delete all the objects in an array before I run my other tests.

Scenario: Cleanup

1st call - retrieves an array of objects and I assign the object in the [0] position to a variable.

2nd call - I then use that variable in a Delete call to delete that object.

Repeat calls 1 and 2- I want to run the GET call each time to assign the new object in the [0] position and then run the Delete call again until the array is empty.

Last call - once the array hits [] the test will stop

If I put the "retry until" only before the Delete call (or any call) it only keeps trying to run that one call multiple times. In the case of the Delete call it only tries to run the same variable value. I need the Delete test to use the new variable each time. I can't figure out how to get the "retry until" action to run multiple steps sequentially

Any help would be greatly appreciated. Or if there is a better way to do this that would be great too.

hamch
  • 1
  • 1
  • Welcome to Stack Overflow. This site is designed to offer help on specific questions, this is more like a wish list. In order to get assistance, you need to post the code you have right now, and somehow showing your error-ed results so that someone can assist you with the problem. – easleyfixed May 25 '23 at 21:24

1 Answers1

0

I think this is complex logic and you should write your own polling loop instead of using retry until: https://stackoverflow.com/a/55823180/143475 (see link at end of answer)

Also refer this answer for tips on cleanup: https://stackoverflow.com/a/60944060/143475

There may be bugs in Karate, so do consider contributing code, or following this process so that someone can try to fix it: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248