Page 1 of 1

Multiple Suites per Report

Posted: Thu Jun 21, 2012 7:50 am
by artur_gadomski
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:

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();
}
}
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:

Code: Select all

<activity testsuitename...>
    <activity testcasename...>
    </activity>
    <activity testsuitename...>
        <activity testcasename...>
        </activity>
        <activity testsuitename...>
            <activity testcasename...>
            </activity>
        </activity>
    </activity>
</activity>
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.

Re: Multiple Suites per Report

Posted: Fri Jun 22, 2012 12:45 pm
by Support Team
Hi,

you can overcome this issue by simply calling
ActivityStack.End(ActivityStatus.Success);
instead of
TestReport.CurrentTestSuiteActivity.End(ActivityStatus.Success);
Regards,
Tobias
Ranorex Team