How can I run a test case multiple times and store the results in the same log file

I am trying to run a test case x number of times but cannot find a way to do this without creating a keyword (Which is the test) and then running this in a for loop for x number of iterations.
I also use a batch file but this generates multiple log files and I would like to be able to see all the runs in one file where I can easily check the pass/fail
Any help is appreciated!

As you said, I would also run it in a loop.
Eg: FOR ${retry} IN RANGE 20
Yeah is kinda ugly though, I agree.

1 Like

There are various alternatives:

  1. Test templates
  2. Running same test multiple times and then combining results with the Rebot tool.
  3. Using the external data-driver tool.

First two options are explained in the User Guide and you ought to be able to find data-driver project easily as well. I’m a bit hurry and don’t have time to find direct links to more information.

1 Like

We have found repeating testcases very handy for chasing down seemingly random errors. but we didn’t want to make changes to the test code that @pekkaklarck’s #1 or #3 required.

At the time we wrote a script that just copied the testcase into a folder the required number of times (adding an index to the name) and then executed the folder (in parallel with Pabot) Everything showed up in the same test report.

Option #2 sounds pretty good, but I can’t remember why we didn’t do it that way…

1 Like

One more approach, similar to copying files, would be using a pre-run modifier to generate tests dynamically.

1 Like

Hello thank you for the speedy response! I will look into the rebot tool and try to run it at the end of each test automatically