WinXP SP3 (WindowsUpdate done)
Ranorex 3.1.0
*********************************
Hello,
Could you please give me information to solve my newbie problem :
1) I have an application with 3 hardware options (Ao1 to Ao3)
2) I have a TestSuite with 3 tests cases (tc1 to tc3)
3) Ao1 must run only tc1
4) Ao2 must run only tc1 and tc2
5) Ao3 must run only tc1 and tc3
I can do a batch that execute the testSuite with tc : parameter, but it is not very funny and make me a lot of work outside Ranorex (in the real life there is more options and more test cases )
Is it possible to do a check at the startup (with a variable for exemple) to skip a full test case ?
Any other idea ?
Thanks for your help
Multi options application
Re: Multi options application
If you use custom user code this would be pretty simple... write a launcher app that checks which machine you are on and launch the proper scripts accordingly...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Multi options application
Hi,
You can also create a UserCode file where you can check which Test Case you want to run and then you can deselect the ones you do not like to be executed.
Regards,
Markus
Ranorex Support Team
You can also create a UserCode file where you can check which Test Case you want to run and then you can deselect the ones you do not like to be executed.
. // get a list of all active Test Cases of the Test Suite IList<TestCase>testCases = TestSuite.Current.SelectedRunConfig.GetActiveTestCases(); // iterate thru these Test Cases foreach (TestCase testCase in testCases) { // If you'd like to deactivate e.g. Test Case 3 you have to set the CheckState to unchecked // and remove the Test Case from the list of active Test Cases if (testCase.Name == "TestCase3") { testCase.Checked = false; } }Note that you have to activate all Test Cases within Test Suite to have them in the list of active Test Cases.
Regards,
Markus
Ranorex Support Team
Re: Multi options application
Thanks Ciege, but this is the same as write a batch and it is ouside RanorexCiege wrote:... write a launcher app that checks which machine you are on and launch the proper scripts accordingly...
Thanks Markus. Very nice, it is exactly what I need.Support Team wrote:Hi,
You can also create a UserCode file where you can check which Test Case you want to run and then you can deselect the ones you do not like to be executed.
SW
Re: Multi options application
I try to find this statement in Ranorex API documentation, but I didn't found it (local and on the net).// ... TestSuite.Current.SelectedRunConfig.GetActiveTestCases();
What is the namespace and how to find more informations.
Thanks for your help.
SW
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Multi options application
Sorry but we forgot to add the API Documentation for this Class. We will fix this issue with Ranorex 3.1.x.swmatisa wrote:I try to find this statement in Ranorex API documentation, but I didn't found it (local and on the net).
What is the namespace and how to find more informations.
The namespace of this class is
using Ranorex.Core.Testing;Regards,
Peter
Ranorex Team
Re: Multi options application
Thanks for the answer. OK, I wait the new documentation.Support Team wrote:Sorry but we forgot to add the API Documentation for this Class. We will fix this issue with Ranorex 3.1.x.
SW
Re: Multi options application
SOLUTION
I select my test cases in the "setup" like your description, but before I must save all TestCases, to reselect all in the "teardown". Otherwise, a deselected test case is never reselected.
To solve this case, I create a class:
It is not so easySupport Team wrote:You can also create a UserCode file where you can check which Test Case you want to run and then you can deselect the ones you do not like to be executed.// get a list of all active Test Cases of the Test Suite IList<TestCase>testCases = TestSuite.Current.SelectedRunConfig.GetActiveTestCases();
I select my test cases in the "setup" like your description, but before I must save all TestCases, to reselect all in the "teardown". Otherwise, a deselected test case is never reselected.
To solve this case, I create a class:
/// <summary> /// Description of TestCasesSingleton. /// </summary> public class TestCasesSingleton { static TestCasesSingleton _Instance = null; static public TestCasesSingleton Instance { get { if (null == _Instance) { _Instance = new TestCasesSingleton(); } return _Instance; } } private TestCasesSingleton() { } IList<TestCase> m_AllTestCases = null; public IList<TestCase> AllTestCases { get { return m_AllTestCases;} set { if (m_AllTestCases == null) { m_AllTestCases = value; } } } public void EnableAll() { foreach(TestCase tc in m_AllTestCases) { tc.Checked = true; } } }I hope this will help somebody else.
SW