Page 1 of 1

How to configure test case in runtime

Posted: Sun Apr 13, 2014 12:52 pm
by ElenaC
Hi

I need to configure my test suite in runtime. (to chose what exactly testCases i want to run)
How can i do that?

Thanks.

Re: How to configure test case in runtime

Posted: Sun Apr 13, 2014 1:58 pm
by odklizec
Hi,

Do you want to run just one test case or more test cases?

In case you want to run just one test case, use this command line:
YourTestSuite.exe /tc:TestCaseName

For running multiple test cases, it's better to use so called "configurations" where you can define a list of testcases and assign each list a configuration name. Then you call these configurations via command line...
YourTestSuite.exe rc:<configuration name>

Configurations could be defined via Ranorex studio (stored in rxtst file)...
http://www.ranorex.com/support/user-gui ... html#c3019

For more command line arguments check out this page:
http://www.ranorex.com/support/user-gui ... html#c4827

Re: How to configure test case in runtime

Posted: Sun Apr 13, 2014 2:27 pm
by ElenaC
Thanks for your reply.
But I just want to the same from code and not using the CLI.

How can i do that in the code?
For example i'm trying this code in order to add a TestCase to Selected Run Config:

CaseInsensitiveString s = new CaseInsensitiveString("6a0b5567-5f24-4477-b246-af365ec8290a");
TestSuite.Current.SelectedRunConfig.AddTestCase(s);

But the specified TestCase (GUID) is not running.

Please help :)

Re: How to configure test case in runtime

Posted: Sun Apr 13, 2014 3:00 pm
by odklizec
I'm not quite sure, but I don't think it's possible to change the configuration from code. But it should be possible to run a test case by condition. Would it be a way for you? Check this discussion...
http://www.ranorex.com/forum/starting-t ... t3899.html