Hi,
Here is the code which should make the trick.
This code snippet should be located in a Module of your TestCase:
if(iteration>yourLimit)
ActivityStack.Current.Parent.CustomProperties["ignore"] = "";
You can also rename the property.
Don't forget to add "using Ranorex.Core.Reporting;" to the specific module.
This code snippet should be added to your Program.cs:
[STAThread]
public static int Main(string[] args)
{
Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;
int error = 0;
TestSuite.TestSuiteCompleted+= new EventHandler(TestSuite_TestSuiteCompleted);
try
{
error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine);
}
catch (Exception e)
{
Report.Error("Unexpected exception occurred: " + e.ToString());
error = -1;
}
return error;
}
static void TestSuite_TestSuiteCompleted(object sender, EventArgs e)
{
ActivityStack.Instance.VisitAll(a => {
if (a.CustomProperties.ContainsKey("ignore"))
a.Status = ActivityStatus.Ignored;
return true;
});
}
This code will grey out the specific iterations in the report.
I hope this will help you solve the issue.
Regards,
Larissa
Ranorex Support Team