Page 1 of 1

some questions on Ranorex.Report

Posted: Sat Jan 29, 2011 5:49 pm
by WajdaW
First, report won't create. I used try-catch block to catch all the exceptions in my test methods and in catch block I am calling method which looks like this:

Code: Select all

private void ErrorLog(Exception ex)
        {
            string logFileName = TestContext.CurrentContext.Test.Name + ".rxlog";
            Ranorex.Report.Setup(Ranorex.ReportLevel.Debug, logFileName, true, false);
            Ranorex.Report.Error(ex.ToString());
            Ranorex.Report.Screenshot();
            Ranorex.Report.End();
            throw ex;
        }
After I generate report I throw exception for Nunit to fail test.
I thought ranorex report with specific name will be created, but it wouldn't.
Second, is there any way to rename screenshot image file by some custom name?

Regards,

Vajda Vladimir

Re: some questions on Ranorex.Report

Posted: Mon Jan 31, 2011 4:36 pm
by Support Team
Hi,

I tried this out and it is working as expected. Could it be that the working directory is different as expected?
Means, the location of the log file is different as expected. Please set a fixed location where your log file should be stored and try it again. For example
string logFile = "C:\\Temp\\" + filename + ".rxlog";
Regards,
Peter
Ranorex Team

Re: some questions on Ranorex.Report

Posted: Sun Feb 06, 2011 9:53 pm
by WajdaW
I managed to create report.
The problem was that I had quotes in my file name string, and they are forbidden in file name path in windows...
But strange there was no any exception thrown about that...

Regards,

Vajda Vladimir