try
{
Validate.Attribute(repo.FormVIP_Database.TextVIP_count__1Info, "Text", count);
}
catch
{
restoreModule.Start();
throw;
}
IReportItem Failed = null;
foreach (IReportItem rep in TestReport.CurrentTestCaseActivity.Children)
if ((rep as Activity).Status == Ranorex.Core.Reporting.ActivityStatus.Failed)
Failed = rep;
if (Failed != null)
{
repo.FormVIP_Database.ButtonClose.Click();
Host.Local.RunApplication("C:\\Ranorex\\samples\\VipApplication.exe", "");
}using Ranorex; using Ranorex.Core; using Ranorex.Core.Testing; using Ranorex.Core.Reporting;
TestCase
Module1.rxrec or cs
Module2.rxrec or cs
...
teardown
tdmodule.rxrec or cs
//find failed module
static class FailedFinder
{
static public void Search(Activity act)
{
static public Activity Failed = null;
foreach (Activity child in act.Children)
{
if (child is TestModuleActivity)
{
if (child.Status == Ranorex.Core.Reporting.ActivityStatus.Failed)
Failed = child;
}
else
Search(child);
}
}
}
//this is a user code method
public void TestFail()
{
FailedFinder.Search(TestReport.CurrentTestCaseActivity);
if (FailedFinder.Failed != null)
{
Report.Info("Failure in this test case");
}
}Users browsing this forum: No registered users and 0 guests