Page 1 of 1

Iterations as a variable

Posted: Fri Jul 06, 2018 7:56 am
by Peter@Vecscan
I have a testsuite in Ranorex +20 test cases. The cases needs on most occasions to run several times, standard is 3. Do do this I have set the 'Iteration' property on each test case to 3. If a want to run the suite but with only 1 iteration I need to edit the 'iteration' property for all of the test cases in the suite. Is there any way to set the 'iteration' property as a variable so I only need to edit this in one place?

Re: Iterations as a variable

Posted: Mon Jul 09, 2018 6:22 pm
by N612
If you don't need each test case to run its own iteration sequentially, you can nest all your test cases in a single smart folder. The only potential issue with this is that it will run TC1 > TC2 > TC3 > TC1 > TC2 > TC3... instead of TC1 > TC1> TC1> TC2> TC2 > TC2... which may not work for your test.
pic1.png
If this is an issue, you can easily change the iteration count across your test suite by multi-selecting each test case:
pic2.png
Hope this helps!

Re: Iterations as a variable

Posted: Tue Jul 10, 2018 9:20 am
by odklizec
Hi,

Unfortunately, it seems to be impossible to set the IterationCount from code. Hence there is no way to set IterationCount from variable. However, it's possible to create a dynamic data connector from code, which can basically simulate the IterationCount! I'm using this approach in some of my tests ;) Take a look at this post:
https://www.ranorex.com/forum/how-to-dy ... tml#p49222
Basically, you have to create a new code module, placed before the test case/smart folder in question. Then you can create a dynamically loaded data connector, with variable number of rows. Hope this helps?