multiple reports per run : Bug Reports

multiple reports per run

Bug reports and feature requests.

multiple reports per run

Postby Elena » Fri Jul 15, 2011 2: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: 11
Joined: Thu Mar 10, 2011 1:47 pm
Location: Copenhagen, Denmark

Re: multiple reports per run

Postby Elena » Fri Jul 15, 2011 2: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();

        }
Elena
 
Posts: 11
Joined: Thu Mar 10, 2011 1:47 pm
Location: Copenhagen, Denmark

Re: multiple reports per run

Postby Support Team » Mon Jul 18, 2011 4:05 pm

Hi,

to reset your report you can use following line of code:
Code: Select all
ActivityStack.Clear()


Kind regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests