Page 1 of 1

How to customize the report rxlog file NAME.

Posted: Tue Jun 10, 2014 9:04 am
by ghrkus
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.

Re: How to customize the report rxlog file NAME.

Posted: Thu Jun 12, 2014 3:22 pm
by Support Team
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

Re: How to customize the report rxlog file NAME.

Posted: Fri Jun 13, 2014 8:42 am
by ghrkus
Thanks Markus,


It's working. :-)



Regards,

Re: How to customize the report rxlog file NAME.

Posted: Thu Oct 01, 2015 7:34 am
by bennylew
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?!

Re: How to customize the report rxlog file NAME.

Posted: Fri Oct 02, 2015 1:00 pm
by Support Team
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