Hi,
Is it possible to skip test case 2,and jump to test case 3 if test case 1 failed?
Based on the image,How to skip test
How to skip test
You do not have the required permissions to view the files attached to this post.
Re: How to skip test
Hi,
The easiest way to achieve what you want is to set the TC Error Behavior to Continue with sibling, as described here...
http://www.ranorex.com/support/user-gui ... html#c3028
The easiest way to achieve what you want is to set the TC Error Behavior to Continue with sibling, as described here...
http://www.ranorex.com/support/user-gui ... html#c3028
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to skip test
Hi,
If I set 'cont. with sibling' on TC1, it will proceed with TC2.
But what I want is if TC1 failed, it will SKIP TC2 and continue with TC3.
Thanks,
Siti
If I set 'cont. with sibling' on TC1, it will proceed with TC2.
But what I want is if TC1 failed, it will SKIP TC2 and continue with TC3.
Thanks,
Siti
Re: How to skip test
Hi,
In this case, below code should do what you want. Just create a new code module with below code and put it to TearDown section of TestCase1:
In this case, below code should do what you want. Just create a new code module with below code and put it to TearDown section of TestCase1:
if (Ranorex.Core.Testing.TestCase.Current.Status != Ranorex.core.reporting.activitystatus.Success) { TestSuite.Current.GetTestCase("TestCase2").Checked = false; }Hope this helps?
Last edited by odklizec on Mon Feb 08, 2016 11:46 am, edited 1 time in total.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to skip test
Hi odklizec,
In your solution, can you use a variable instead of the hard-coded "TestCase2" so that this same code can be used in the other TestCases and just replacing the value of the variable inside each TestCase?
Or maybe better yet is if the hard-coded <name of testcase> can be replaced with a generic one variable like varSkipNextTest where Ranorex automatically detects the next testcase that is "checked".
Or something like "On Failure, skip next testcase selected/checked.".
Thanks.
Gilbert
In your solution, can you use a variable instead of the hard-coded "TestCase2" so that this same code can be used in the other TestCases and just replacing the value of the variable inside each TestCase?
Or maybe better yet is if the hard-coded <name of testcase> can be replaced with a generic one variable like varSkipNextTest where Ranorex automatically detects the next testcase that is "checked".
Or something like "On Failure, skip next testcase selected/checked.".
Thanks.
Gilbert
Re: How to skip test
Hi Gilbert,
Of course, you can replace the test case name with whatever you want, including variable holding the test case name.
Of course, you can replace the test case name with whatever you want, including variable holding the test case name.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to skip test
Hi Pavel,
Can you please give more details on how or where to add/use variables in the Test Suite?
Perhaps you can give a sample.
You have a Test Suite containing 5 Test Cases, for example TestCase1 to TestCase5. In your sample code as solution, I see "TestCase2" hardcoded. Where in TestCase1 can you set the variable to skip the next testcase which is TestCase2?
Thanks.
Gilbert
Can you please give more details on how or where to add/use variables in the Test Suite?
Perhaps you can give a sample.
You have a Test Suite containing 5 Test Cases, for example TestCase1 to TestCase5. In your sample code as solution, I see "TestCase2" hardcoded. Where in TestCase1 can you set the variable to skip the next testcase which is TestCase2?
Thanks.
Gilbert
Re: How to skip test
Another alternative, would be considering that "TestCase2" is dependent on "TestCase1", is you could nest TestCase 2 within TestCase1.
That way the "continue with sibling" would ensure that TestCase 2 would get skipped if TestCase1 fails.
It's also good to use the SETUP/TEARDOWN items to ensure stuff such as your "Exit_DVS" always get run to return the AUT to a known state ready for the next test case.
That way the "continue with sibling" would ensure that TestCase 2 would get skipped if TestCase1 fails.
It's also good to use the SETUP/TEARDOWN items to ensure stuff such as your "Exit_DVS" always get run to return the AUT to a known state ready for the next test case.
You do not have the required permissions to view the files attached to this post.