Page 1 of 1

How to run multiple ranorex tests from command line ?

Posted: Fri Oct 12, 2018 8:41 pm
by hghesani
Hi

I am aware that we can run one ranorex test from command line. Like the following :

YourTestSuite.exe /tc:TestCaseName

But lets say as a part of continuous integration I am dynamically generating a test list which is different everytime. Is there a way to run multiple cases from command line without doing the following :

YourTestSuite.exe /tc:TestCaseName1
YourTestSuite.exe /tc:TestCaseName2
YourTestSuite.exe /tc:TestCaseName3

I would prefer something that is scriptable so that I can have TestCaseName1, TestCaseName2 and TestCaseName3 run together after creating a configuration dynamically or modifying the rxtst files dynamically.

Please let me know.

Thanks

Re: How to run multiple ranorex tests from command line ?

Posted: Mon Oct 15, 2018 2:25 pm
by krstcs
If your CI system is passing a list of test cases that need to be run, then you can do a for loop over that list in a batch command with your generic test EXE name like you have it, but parameterize the testcase like "/tc:%%<t>", where "<t>" is the name of your loop variable.

See this site for batch commands and usage: https://ss64.com/nt/for.html

Since you don't name your CI system or give the actual format of the list being generated, we're probably not going to be able to give much more specific help.

Re: How to run multiple ranorex tests from command line ?

Posted: Mon Oct 22, 2018 1:43 pm
by TimoL
I have a question related to this. I have the following simplified structure:

Project
Test suite 1
TC1
TC2
TC11
TC22

I want to run the test cases TC1 and TC2 regularly from Jenkins, but TC11 and TC22 only by hand from Ranorex. The test cases uses same modules which are used within that test suite only. What would be the best way to proceed?

a) Run multiple testcases in one Jenkins build. Seems that this is not possible as told above. Command line argument “/tc:TC1 /tc:TC2” does not work
b) move test cases TC11 and TC22 under a new test suite, Test suite 2 under the same project. Then run Test suite 1 in Jenkins
c) move TC1 and TC2 under a new smart folder and run that smart folder in Jenkins
d) something else?

Re: How to run multiple ranorex tests from command line ?

Posted: Mon Oct 22, 2018 2:00 pm
by odklizec
Hi,

The easiest way to achieve what you want is to use Run configuration, as described here:
https://www.ranorex.com/help/latest/ran ... igurations
Simply define first run configuration(e.g. called JenkinsRun), which will contain TC1 and TC2. Then second run configuration (e.g. called ManualRun), which will contain TC11 and TC22. Then in jenkins job config, you need to define proper run configuration, via Ranorex command line arguments (/rc:RunConfigName). Hope this helps?

Re: How to run multiple ranorex tests from command line ?

Posted: Tue Oct 23, 2018 8:26 am
by TimoL
Thanks, this was an easy solution!