How to customize the report rxlog file NAME.

Ask general questions here.
ghrkus
Posts: 14
Joined: Mon Apr 09, 2012 12:35 pm

How to customize the report rxlog file NAME.

Post by ghrkus » Tue Jun 10, 2014 9:04 am

Hi,

Is there a way to to give a custom name rather than it taking the log name from properties?

I know we can setup log name using %S%T%D..etc

But I want to name the log file depending on the test cases am running. like eg. UseThisName.rxlog, MyTestLog.rxlog..

I tried to use "Ranorex.Core.Reporting.TestReport.ReportFilename" but am getting a warning saying it's 'obsolete and try to use TestReport.ReportEnvironment.ReportName.'

But how can I assign custom name to this property? I am getting an error saying that it is a read-only property and can't assign any value to it.

Please let me know if there is a way to use custom name for my rxlog.

Thanks.

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

Re: How to customize the report rxlog file NAME.

Post by Support Team » Thu Jun 12, 2014 3:22 pm

Hi,

I already forwarded the feature request to allow the use of the test case name as part of the report file name.
Meanwhile you can use the following code to create a report with the name of the test case:
TestReport.Setup(ReportLevel.Info,TestReport.ReportEnvironment.ReportFileDirectory+ "\\" + TestCase.Current.Name+".rxlog",true);
Regards,
Markus

ghrkus
Posts: 14
Joined: Mon Apr 09, 2012 12:35 pm

Re: How to customize the report rxlog file NAME.

Post by ghrkus » Fri Jun 13, 2014 8:42 am

Thanks Markus,


It's working. :-)



Regards,

bennylew
Certified Professional
Certified Professional
Posts: 24
Joined: Wed Sep 17, 2014 10:43 am

Re: How to customize the report rxlog file NAME.

Post by bennylew » Thu Oct 01, 2015 7:34 am

I'm facing a similar problem: I want to use a global Parameter (name of the testenvironment) as suffix in the reportname. I tried the solution with Testreport.Setup, but the name of the saved reportfile did not change.
I'm using this peace of code at Setup Region of my testsuite. Maybe this is the fault, because the file was already created at this Point?!

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

Re: How to customize the report rxlog file NAME.

Post by Support Team » Fri Oct 02, 2015 1:00 pm

Hello bennylew,

Unfortunately, we are not able to reproduce the mentioned behavior on our machines. Please ensure that you are using our latest version, currently Ranorex 5.4.2.

Also, please note the calling the "TestReport.Setup()"-method creates an additional report and does not modify the "actual" report.

Hope this information helps.

Regards,
Robert