Logging and Screenshots

Ask general questions here.
erman
Posts: 15
Joined: Tue May 15, 2012 3:53 pm

Logging and Screenshots

Post by erman » Thu Jun 28, 2012 10:26 pm

Hi,

I have 2 basic questions that I haven't been able to locate anything searching the forums:

1) How is Ranorex logging turned off? I have tried "Report.Setup(RepportLevel.None, "", false), but I get a compiler error.

2)Is there any way to redirect "Report.Screenshot" to a specific folder location?


Thanks for any help!
Eric

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Logging and Screenshots

Post by Support Team » Fri Jun 29, 2012 12:38 pm

Hello Eric,

You can change the report settings in the Properties window from the test suite.
ReportSettings.jpg
ReportSettings.jpg (69.64 KiB) Viewed 810 times
If you want to use the Report.Setup() method in the user code from specific recording you have to use this line:
Report.Setup(ReportLevel.None, null, false);
If you use this, a report will be generated, but there will be no messages from the recording in it.

Regards,
Bernhard
Ranorex Support Team
.
Image

erman
Posts: 15
Joined: Tue May 15, 2012 3:53 pm

Re: Logging and Screenshots

Post by erman » Fri Jun 29, 2012 1:54 pm

Thanks for the response.

But, is there a way to take screenshots when the Report is turned off?

Also, can the screenshot be renamed and redirected to a user-defined folder location?


Eric

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Logging and Screenshots

Post by Support Team » Mon Jul 02, 2012 10:41 am

Hi,

Yes, you can create and save them to a specific directory even if the report is turned off.
Here is a code:
Imaging.CaptureImage(repo.Calculator.Close.Element).Save(@"C:/image.jpg"); // you can take any Element
and the link to our online API: Imaging Class.
Hope this will help.

Regards,
Markus
Ranorex Support Team
.
Image

erman
Posts: 15
Joined: Tue May 15, 2012 3:53 pm

Re: Logging and Screenshots

Post by erman » Mon Jul 02, 2012 2:18 pm

Thanks a lot!