some questions on Ranorex.Report

Class library usage, coding and language questions.
WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

some questions on Ranorex.Report

Post by WajdaW » Sat Jan 29, 2011 5:49 pm

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

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

Re: some questions on Ranorex.Report

Post by Support Team » Mon Jan 31, 2011 4:36 pm

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

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: some questions on Ranorex.Report

Post by WajdaW » Sun Feb 06, 2011 9:53 pm

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