Multiple Suites per Report
Posted: Thu Jun 21, 2012 7:50 am
Hi
Our Automation is running data based tests, with mode of the test defined in test data. One of the modes requires all reports to be combined into one. We have managed it by setting up report for each data row using the same name, setting up a suite and not clearing activity stack. Something like this:
That worked great for Ranorex 3.2 although as I now look at the reports created a nested test suite activities. But even with incorrect structure RanorexReport3.xsl was able to deal with that and display report correctly. With change to Ranorex 3.3 this bug was fixed . Reports now can not open nested test cases.
I have tried adding a line:
TestReport.CurrentTestSuiteActivity.End(ActivityStatus.Success);
But it seems this does nothing. Test suites are still nested.
So...
Starting multiple test suites (even with ending test suites activities) produces report like this:
This report works with xsl file from 3.2 but not 3.3.
Fixing this manually works with both xsl files.
The important bug is End on current test suite activity doesn't work.
I have since fixed the code so that test suite is only created once for combined report mode, which of course works.
Our Automation is running data based tests, with mode of the test defined in test data. One of the modes requires all reports to be combined into one. We have managed it by setting up report for each data row using the same name, setting up a suite and not clearing activity stack. Something like this:
Code: Select all
foreach (var row in rows) {
if (mode.combined) { reportName = notchanged}
else {reportName = generateUniqueName();}
Test.Report.Setup(ReportLevel.Debug, reportName, true);
TestReport.BeginTestSuite(title);
//tests
TestReport.SaveReport();
if (!mode.combined)
{
TestReport.SaveReport();
ActivityStack.Clear();
}
}
I have tried adding a line:
TestReport.CurrentTestSuiteActivity.End(ActivityStatus.Success);
But it seems this does nothing. Test suites are still nested.
So...
Starting multiple test suites (even with ending test suites activities) produces report like this:
Code: Select all
<activity testsuitename...>
<activity testcasename...>
</activity>
<activity testsuitename...>
<activity testcasename...>
</activity>
<activity testsuitename...>
<activity testcasename...>
</activity>
</activity>
</activity>
</activity>
Fixing this manually works with both xsl files.
The important bug is End on current test suite activity doesn't work.
I have since fixed the code so that test suite is only created once for combined report mode, which of course works.