some questions on Ranorex.Report : Automation API

some questions on Ranorex.Report

Class library usage, coding and language questions.

some questions on Ranorex.Report

Postby WajdaW » Sat Jan 29, 2011 6: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
WajdaW
 
Posts: 72
Joined: Wed Jan 05, 2011 7:45 pm

Re: some questions on Ranorex.Report

Postby Support Team » Mon Jan 31, 2011 5: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: some questions on Ranorex.Report

Postby WajdaW » Sun Feb 06, 2011 10: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
WajdaW
 
Posts: 72
Joined: Wed Jan 05, 2011 7:45 pm


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests