Class library usage, coding and language questions.
- Posts: 1
- Joined: Tue Jul 01, 2014 6:23 am
We are trying to enable/disable testcases in a test suite dynamically just before starting the execution. Planning to use
Code: Select all
What is the best way to get the list of testcases from the test suite using ranorex APIs so that we can iterate through it to enable/disable the test cases.
- Site Admin
- Posts: 12169
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
Would the following forum thread be of help for you: Starting Testcase by condition
Do you know that you can also specify different so called Run Configurations
This allows you to specify and then select different testcase configurations. You can also select a specific testcase configuration by using the command line argument described here Running Tests without Ranorex Studio
Runs the test cases of the specified configuration defined by the rxtst file. Configurations can be edited using Ranorex Studio or TestSuiteRunner. By default, the currently selected run config is used.
Please let me know when you need further assistance!
- Posts: 14
- Joined: Fri Jul 11, 2014 2:25 pm
TestCases hold only guid strings not the class themselves. To get the active test cases I used the following code
Code: Select all
List<string> tcases = new List<string>(); //all testcases in this testsuite
int i = 0;
var rconf = TestSuite.Current.SelectedRunConfig.GetActiveTestCases();
for (i =0; i< rconf.Count; i++)
Type types = Assembly.GetExecutingAssembly().GetTypes();
foreach (Type tp in types)
if( tcases.Contains(tp.Name) )
//'tp' it is a test case