Iterations as a variable
-
- Posts: 7
- Joined: Tue Mar 27, 2018 10:29 am
Iterations as a variable
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
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.
If this is an issue, you can easily change the iteration count across your test suite by multi-selecting each test case:
Hope this helps!
If this is an issue, you can easily change the iteration count across your test suite by multi-selecting each test case:
Hope this helps!
Re: Iterations as a variable
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?
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

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration