Page 1 of 1

multiple reports per run

Posted: Fri Jul 15, 2011 1:12 pm
by Elena
Hi,

I have C# code running tests, which call Ranorex Repository items and uses Ranorex 3 logging. During the test, I run one test suite few times and generate files with different names each time.

The problem is that those files contain all information that happened before the file, too. For example, in the beginning of the suite I call TestReport.Setup(*parameters*) and in the end I call Report.End() and TestReport.SaveReport(). Then, suite starts again and it starts with Setup call with different file name. But once the whole test is done, the second report contains information from first and second tests, the third one contains information from first, second and third and so on.

Is there any way to prevent this? it doesn't seem like Report.End() does anything here...


I'm running on Ranorex 3.0.4, VS 2010, Windows 7 x64.


Kind regards,
Elena

Re: multiple reports per run

Posted: Fri Jul 15, 2011 1:41 pm
by Elena
In short, this is the code I'm running:
static void Main(string[] args)
        {
            TestReport.Setup(ReportLevel.Debug, "file1.rxlog", true);
            TestReport.BeginTestSuite("My test suite 1");
            TestReport.BeginTestModule("Test module - pre test case");
            TestReport.EndTestModule();
            TestReport.BeginTestCase("My test case 1");
            TestReport.BeginTestModule("test module - in test case");
            TestReport.EndTestModule();
            TestReport.EndTestCase();
            TestReport.BeginTestModule("Test module - post test case");
            TestReport.EndTestModule();
            TestReport.SaveReport();


            Report.End();

            TestReport.Setup(ReportLevel.Debug, "file2.rxlog", true);
            TestReport.BeginTestSuite("My test suite 1");
            TestReport.BeginTestModule("Test module - pre test case");
            TestReport.EndTestModule();
            TestReport.BeginTestCase("My test case 2");
            TestReport.BeginTestModule("test module - in test case");
            TestReport.EndTestModule();
            TestReport.EndTestCase();
            TestReport.BeginTestModule("Test module - post test case");
            TestReport.EndTestModule();
            TestReport.SaveReport();

        }

Re: multiple reports per run

Posted: Mon Jul 18, 2011 3:05 pm
by Support Team
Hi,

to reset your report you can use following line of code:

Code: Select all

ActivityStack.Clear()
Kind regards,
Tobias
Support Team