Skipping in Ranorex

169 Views Asked by At

How to skip the remaining test case in Ranorex, if a certain condition is not met? Skipping in this context means to cancel the further test execution and to mark the corresponding test case differently in the test report as FAILed (red) or PASSed (green).

1

There are 1 best solutions below

0
else42.de On
TestSuite.Current.GetTestContainer("testcase1").Checked = false;

// TestSuite.Current.GetTestContainer("testcase2").Checked = true; // this is how you could start an alternative to the skipped test case
// TestSuite.Current.GetTestContainer("smartfolder1").Checked = false; // this way you can skip an entire smartfolder.

Note 1: The test case/test container skipped this way does not show up in the test report at all. So this solution is only an 80% solution.

Note 2: If you have multiple TestContainers with the same name, only the first one will be skipped. I have just tried this.