Page 1 of 1

Ranorex.Screenshot();

Posted: Wed Feb 27, 2013 5:31 am
by yinghu
Hi folks,

I'm developing automation test project using Ranorex APIs in Visual Studio with C#.
And I'm trying to customize report with screenshots. Everything works great but
Ranorex.Screenshot() can not create a shot in the report at all. I tried Ranorex.Screenshot() in
Ranorex studio, it works well.

Is there any additional settings I need to do if I work on Visual Studio not Ranorex Studio?

Any help?

Thanks alot!!

yinghu

Re: Ranorex.Screenshot();

Posted: Wed Feb 27, 2013 4:27 pm
by Ciege
I use Report.Screenshot(); throughout my code (C# in VS) with no issues...

Are you getting any errors?
Are you creating the report through the API before trying to access it?
Does any report exist at the end of runtime (just missing the screenshots)?

Re: Ranorex.Screenshot();

Posted: Wed Feb 27, 2013 5:34 pm
by yinghu
Again, thanks alot Ciege! You help me alot!!

Well, I didn't get any errors and the report was created. Just without any screenshots in the report and no any screenshot image in the folder where report file locates.

Here is the code snippet:

using Ranorex.Core.Reporting;
.....
XmlLogger.SetReportStylesheetFile("/ATL/Ranorex/Stylesheet.xsl");

Report.Setup(ReportLevel.Debug, "/ATL/Ranorex/" + myTimeStamp + ".rxlog", true);
Report.Start();
Report.SystemSummary();
Report.Screenshot(); //////////DOESN'T WORK?????????
Report.End();

And the env is Ranorex 4.0, windows 7 pro in VM, accessed by Desktop Remote Control.

Stylesheet.xsl is a Ranorex default file.
Ciege wrote:I use Report.Screenshot(); throughout my code (C# in VS) with no issues...

Are you getting any errors?
Are you creating the report through the API before trying to access it?
Does any report exist at the end of runtime (just missing the screenshots)?

Re: Ranorex.Screenshot();

Posted: Wed Feb 27, 2013 5:41 pm
by Ciege
Interesting... You seem to be doing pretty much what I do yet I don't see the issue you have.

I don't use this line:
XmlLogger.SetReportStylesheetFile("/ATL/Ranorex/Stylesheet.xsl");

I also name my report with a .XML extension instead of the .RXLOG extension. but everything else looks the same...

Re: Ranorex.Screenshot();

Posted: Wed Feb 27, 2013 6:10 pm
by yinghu
This is what I get in the attachment using above code snippet.

I am guessing there could be something wrong with my env.

Let me see if I will get more other helps, or I will code the Ranorex.Screenshot() myself.

Thanks, I got alot from you posts. Thanks buddy!



Ciege wrote:Interesting... You seem to be doing pretty much what I do yet I don't see the issue you have.

I don't use this line:
XmlLogger.SetReportStylesheetFile("/ATL/Ranorex/Stylesheet.xsl");

I also name my report with a .XML extension instead of the .RXLOG extension. but everything else looks the same...

Re: Ranorex.Screenshot();

Posted: Wed Feb 27, 2013 6:25 pm
by Ciege
yinghu wrote:This is what I get in the attachment using above code snippet.

I am guessing there could be something wrong with my env.

Let me see if I will get more other helps, or I will code the Ranorex.Screenshot() myself.

Thanks, I got alot from you posts. Thanks buddy!
OK, good luck!
And you are quite welcome!

Re: Ranorex.Screenshot();

Posted: Thu Feb 28, 2013 1:28 pm
by hs.fk
I think you probably encounter this bug:

XmlLogger.LogData produces no output : Bug Reports

Re: Ranorex.Screenshot();

Posted: Fri Mar 01, 2013 3:39 pm
by yinghu
Thanks alot!!
hs.fk wrote:I think you probably encounter this bug:

XmlLogger.LogData produces no output : Bug Reports