1

At core of question I am randomly defining a variable as a string of numbers then passing it into an API. If the string already exists within the environment then the api will pass. If it fails then it does not exist. I want the the test to fail as I then export this variable to other tests to be used to create the variable on the environment.

Because I want it to fail I set the retry statement as follows:

    And retry until (utils.print(karate, response, responseHeaders) || true) && !response.data

I am confused if it does hit the retry will it redefine the randomized variables set in the background, or will it just keep trying to hit hit the API with the variable as it was first defined?

  • the moment you said `export variable to other tests` I have only this to say: https://stackoverflow.com/a/46080568/143475 – Peter Thomas Sep 26 '22 at 17:48

0 Answers0