How to append report to an existing report file in 4.0.3 ?

Ask general questions here.
troy
Posts: 9
Joined: Wed Apr 29, 2009 3:39 am

How to append report to an existing report file in 4.0.3 ?

Post by troy » Thu Jun 06, 2013 10:11 am

Hi,

The method Ranorex.Core.Reporting.TestReport.Setup(), it seems to over-write the specified file.

Is there any way to tell it to append new report(maybe after reboot system)to an existing log file?

Many thanks in advance!
Think Different!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to append report to an existing report file in 4.0.3 ?

Post by Support Team » Fri Jun 07, 2013 8:09 am

Hello,

In general the class TestReport provides structured reporting functionality if you do not use Ranorex Studio and its generated test suite.
Are you using Ranorex Studio for your tests?
I am afraid that I do not completely understand what you are trying to do.
Could you please describe your issue in more detail?
Thank you!

Regards,
Bernhard
.
Image

troy
Posts: 9
Joined: Wed Apr 29, 2009 3:39 am

Re: How to append report to an existing report file in 4.0.3 ?

Post by troy » Fri Jun 07, 2013 9:51 am

Support Team wrote:Hello,

In general the class TestReport provides structured reporting functionality if you do not use Ranorex Studio and its generated test suite.
Are you using Ranorex Studio for your tests?
I am afraid that I do not completely understand what you are trying to do.
Could you please describe your issue in more detail?
Thank you!

Regards,
Bernhard
Yes,Bernhard. I'm using Ranorex Studio 4.0.3 for automation test.

Here is my issue detail:
------------------------------------------------------------------------------------------------------------
//set up a report first
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.Debug, "c:\test.rxlog",true);
//report some infomation
Report.Success("test pass...");
Report.End();
------------------------------------------------------------------------------------------------------------

Then I need to reboot test machine, and run a Ranorex test case again,

Using below method will always overwrite the existing report file("c:\test.rxlog")
------------------------------------------------------------------------------------------------------------
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.Debug, "c:\test.rxlog",true);
Report.Warn("How to append msg to a existing report? ");
------------------------------------------------------------------------------------------------------------

So how could I appending report messages(but not overwrite) to the existing report file("c:\test.rxlog") ?


I'm looking forward to your professional and kindly help, many thanks!
Think Different!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3949
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to append report to an existing report file in 4.0.3 ?

Post by odklizec » Fri Jun 07, 2013 10:25 am

Try this...
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.Debug, "c:\test.rxlog",true);
XmlLogger.AppendExisting=true;
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

troy
Posts: 9
Joined: Wed Apr 29, 2009 3:39 am

Re: How to append report to an existing report file in 4.0.3 ?

Post by troy » Sat Jun 08, 2013 2:49 am

odklizec wrote:Try this...
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.Debug, "c:\test.rxlog",true);
XmlLogger.AppendExisting=true;
Thanks,odklizec.
I tried what you mentioned, but it also did not work. :(
//set up a report first
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.Debug, "c:\test.rxlog",true);
XmlLogger.AppendExisting=true; 
//report some infomation
Report.Success("test pass...");
Report.End();
Report "c:\test.rxlog" will be generated, and show a green message "test pass..."

Then reboot test machine, and run below sentences:
//set up an existing report, and need to appending new messages to it
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.Debug, "c:\test.rxlog",true);
XmlLogger.AppendExisting=true; 
Report.Warn("How to append msg to a existing report? ");
Check the same report "c:\test.rxlog" , but there is only a warn message shows "How to append msg to a existing report?", the previous existing message "test pass..." disappeared :(

Obviously, the new report messages also overwrote the existing report messages, how to avoid this ?
Is there any other way?
Think Different!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3949
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to append report to an existing report file in 4.0.3 ?

Post by odklizec » Mon Jun 10, 2013 8:22 am

Yes, you are right. The report file is always overwritten. OK, let's wait for the answer from RX support folks. Maybe I got the purpose of XmlLogger.AppendExisting wrong or we use it in a wrong way? ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to append report to an existing report file in 4.0.3 ?

Post by Support Team » Mon Jun 10, 2013 4:41 pm

Hello,

The XmlLogger.AppendExisting property is unfortunately not working for the 4.x report. This is a method which can be used in the old 2.x Report. Unfortunately it not possible to add a message to an existing Report file, if you use the TestReport class.

Regards,
Bernhard
.
Image

troy
Posts: 9
Joined: Wed Apr 29, 2009 3:39 am

Re: How to append report to an existing report file in 4.0.3 ?

Post by troy » Thu Jun 13, 2013 3:48 am

Support Team wrote:Hello,

The XmlLogger.AppendExisting property is unfortunately not working for the 4.x report. This is a method which can be used in the old 2.x Report. Unfortunately it not possible to add a message to an existing Report file, if you use the TestReport class.

Regards,
Bernhard
Bernhard,thanks for your answer! Is there any schedule to fix this issue?
We are looking forward to see AppendExisting function works for the 4.x report.
Think Different!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to append report to an existing report file in 4.0.3 ?

Post by Support Team » Fri Jun 14, 2013 2:59 pm

Hello,

This is not really a bug in Ranorex.
The old 2.x Report provided this functionality because there was no TestSuite structure.
The new TestReport class doesn't provide this feature because this would break the structure in the report.
It is not really recommended, but you can create your own Report using the XMLLogger class.

Regards,
Bernhard
.
Image

oliverhu
Posts: 2
Joined: Sat Jun 08, 2013 4:19 am

Re: How to append report to an existing report file in 4.0.3 ?

Post by oliverhu » Wed Jul 10, 2013 8:23 am

Bernhard

This will be so unreasonable.Once rebooted, we need to create a completely new report.