I know I can use Validate.Exists() for the repo item and then use the following to skip the rest of the iteration:
Code: Select all
throw new RanorexException();
Code: Select all
throw new RanorexException();
Code: Select all
[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;
});
}
Code: Select all
if(iteration>yourLimit)
ActivityStack.Current.Parent.CustomProperties["ignore"] = "";