Hi All,
I am new to Ranorex.
My objective is to either execute a testcase or not depending on the test case parameter (e.g. RunTestCase=Y or N)
Therefore, I would like to either skip test case execution to next iteration or to jump to a dummy test module
such that the next iteration continues.
I was thinking of putting a custom code which can read the test case parameter value. however, I am not sure which coding statement to use to indicate that "jump to next iteration".
public bool GetRunTest()
{
bool runTest = testCaseParameters["RunTest"].Equals("P", StringComparison.OrdinalIgnoreCase);
if (!RunTest)
//TestCase.Current.
return;
//return runTest;
}
How to Continue to next iteration or jump to a test module
Re: How to Continue to next iteration or jump to a test module
To run or skip a TC based of a parameter (e.g. Global Parameter) is quite simple. All you need to to is to add a code module before the affected TCs.
Let's say you have TestSuite structure like this:
Then in the code module use code like this:
Hope this helps?
Let's say you have TestSuite structure like this:
Code: Select all
[TSRoot]
|_CodeModule.cs <-- here put the code to eval. the global param. and then enable/disable appropriate TCs
|_[TestCase1]
|_[TestCase2]
Code: Select all
string globalParam= TestSuite.Current.Parameters["gp_NameOfParam"]; //read global parameter value
if (globalParam == "Yes")
{
TestSuite.Current.GetTestCase("TestCase1").Checked = true; //enables TestCase1
TestSuite.Current.GetTestCase("TestCase2").Checked = false; //disables TestCase2
}
else
{
TestSuite.Current.GetTestCase("TestCase1").Checked = false;
TestSuite.Current.GetTestCase("TestCase2").Checked = true;
}
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