Run a unit test multiple times

Asked by Calle Rundgren

I was woundering If there is any way to run the same unit test for example 3 times in a row without restarting the test by clicking the run button?

I tried to make a for-loop which executes in the end of the test and clicks the run button again. But that did not work since the test is not closing until the whole test is finished, and of course I got an error in my test when the "Run" button was not found.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

--- run your tests from command line using option -t and implement the loop in a bat/cmd script.

--- The other option is to switch to using Pythons unittest module, so you can script everything needed in a normal Sikuli script

# section test class preperation
#...
#every thing needed for the testcases
#...

for i in range(3):
    testrunner()

Revision history for this message
Calle Rundgren (c-rundgren) said :
#2

That is easy and nice solutions. Thank you RaiMan. :-)

Revision history for this message
Calle Rundgren (c-rundgren) said :
#3

Thanks RaiMan, that solved my question.