multiple reports per run

Bug reports.
Elena
Posts: 13
Joined: Thu Mar 10, 2011 12:47 pm
Location: Copenhagen, Denmark
Contact:

multiple reports per run

Post by Elena » Fri Jul 15, 2011 1:12 pm

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

Elena
Posts: 13
Joined: Thu Mar 10, 2011 12:47 pm
Location: Copenhagen, Denmark
Contact:

Re: multiple reports per run

Post by Elena » Fri Jul 15, 2011 1:41 pm

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

        }

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: multiple reports per run

Post by Support Team » Mon Jul 18, 2011 3:05 pm

Hi,

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

Code: Select all

ActivityStack.Clear()
Kind regards,
Tobias
Support Team