How to configure test case in runtime

Ranorex Spy, Recorder, and Studio.
ElenaC
Posts: 6
Joined: Mon Feb 17, 2014 7:52 pm

How to configure test case in runtime

Post by ElenaC » Sun Apr 13, 2014 12:52 pm

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to configure test case in runtime

Post by odklizec » Sun Apr 13, 2014 1:58 pm

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
Last edited by odklizec on Sun Apr 13, 2014 2:51 pm, edited 1 time in total.
Pavel Kudrys
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

ElenaC
Posts: 6
Joined: Mon Feb 17, 2014 7:52 pm

Re: How to configure test case in runtime

Post by ElenaC » Sun Apr 13, 2014 2:27 pm

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 :)

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to configure test case in runtime

Post by odklizec » Sun Apr 13, 2014 3:00 pm

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
Pavel Kudrys
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