Page 1 of 1

How can I create a fail suite by turning passing scripts off in the .rxtst file?

Posted: Fri May 17, 2019 3:31 pm
by ian807
I need to create a fail suite. When a script passes, I'd like to modify the rxtst file such that when I open the file, all the passing items on the tree are unchecked while all fails remain checked.

Is there a way to programmatically modify the rxtst file from within Ranorex based on on pass/fail state?

Re: How can I create a fail suite by turning passing scripts off in the .rxtst file?

Posted: Mon May 20, 2019 8:26 am
by Stub
While you can programmatically turn tests on/off at runtime - perhaps by loading a list of failing tests - this won't work on the .RXTST Test Suite.

Code: Select all

TestSuite.CurrentTestContainer.Checked

Re: How can I create a fail suite by turning passing scripts off in the .rxtst file?

Posted: Mon May 20, 2019 1:23 pm
by ian807
So, this would not check the scripts on and off in the .rxtst file? That's exactly what I'm trying to do.

Re: How can I create a fail suite by turning passing scripts off in the .rxtst file?

Posted: Mon May 20, 2019 1:27 pm
by odklizec
Hi,

You can enable/disable test cases/smart folders by this line of code:

Code: Select all

TestSuite.Current.GetTestContainer(testCaseName).Checked = true;
Where "TestCasename" you must replace with test case/smart folder name of your choice. So I think the best approach to do what you want, would be to get the list of failing test cases and then then programmatically enable/disable test cases you want. But no, there is no permanent way to enable/disable test cases directly in rxtst file.

Re: How can I create a fail suite by turning passing scripts off in the .rxtst file?

Posted: Mon May 20, 2019 1:58 pm
by ian807
So "testCaseName" is the arbitrary name of the smart folder?

If so, my next question would be, suppose my suite folders are nested like so:

Code: Select all

MyTopLevelCategory/Mysubcategory/MyTest_01.
Do I call like so:

Code: Select all

TestSuite.Current.GetTestContainer("MyTopLevelCategory/Mysubcategory/MyTest_01").Checked = true;

Code: Select all

TestSuite.Current.GetTestContainer("MyTest_01").Checked = true;
The next question would be, "Is there code to get the current TestCaseName so I can use that as my test container parameter?

Re: How can I create a fail suite by turning passing scripts off in the .rxtst file?

Posted: Tue May 21, 2019 7:38 am
by Stub

Code: Select all

TestSuite.CurrentTestContainer