At the end of each test case, I have a module that grabs the status of the test, and then submits that status to TestRail, so the results update in realtime as the tests progress. I'm able to supply the status of the case, and get that sent to TestRail, but the detail information that ends up in the TestRail report is sparse at best. I'd like to make use of the details in the Ranorex report, but so far I'm not able to get more than just the "Description" field for each module that sits within the test case (but not those within the "Setup" and "Teardown" portions).
I was able to find a forum post http://www.ranorex.com/forum/test-suite ... t2064.html that got me partway there. The code I'm using to grab this information is listed below
Code: Select all
foreach (IReportItem rep in TestReport.CurrentTestCaseActivity.Children)
{
if(rep.ToString() == "Ranorex.Core.Reporting.TestModuleActivity")
{
string DetailMessage = (rep as TestModuleActivity).DetailMessage;
string ErrorMessage = (rep as TestModuleActivity).ErrorMessage;
string Status = (rep as TestModuleActivity).Status.ToString();
TestCaseReport += "\r\n\r\n" + DetailMessage + " - " + Status;
if(Status.ToLower() != "success")
{
TestCaseReport += " - " + ErrorMessage;
}
}
}