Ranorex.Screenshot();

Class library usage, coding and language questions.
yinghu
Posts: 26
Joined: Thu Oct 25, 2012 5:48 pm

Ranorex.Screenshot();

Post by yinghu » Wed Feb 27, 2013 5:31 am

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

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex.Screenshot();

Post by Ciege » Wed Feb 27, 2013 4:27 pm

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)?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

yinghu
Posts: 26
Joined: Thu Oct 25, 2012 5:48 pm

Re: Ranorex.Screenshot();

Post by yinghu » Wed Feb 27, 2013 5:34 pm

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)?

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex.Screenshot();

Post by Ciege » Wed Feb 27, 2013 5:41 pm

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...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

yinghu
Posts: 26
Joined: Thu Oct 25, 2012 5:48 pm

Re: Ranorex.Screenshot();

Post by yinghu » Wed Feb 27, 2013 6:10 pm

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...
You do not have the required permissions to view the files attached to this post.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex.Screenshot();

Post by Ciege » Wed Feb 27, 2013 6:25 pm

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!
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

hs.fk
Posts: 12
Joined: Thu Jul 12, 2012 11:47 am
Location: Hamburg

Re: Ranorex.Screenshot();

Post by hs.fk » Thu Feb 28, 2013 1:28 pm

I think you probably encounter this bug:

XmlLogger.LogData produces no output : Bug Reports

yinghu
Posts: 26
Joined: Thu Oct 25, 2012 5:48 pm

Re: Ranorex.Screenshot();

Post by yinghu » Fri Mar 01, 2013 3:39 pm

Thanks alot!!
hs.fk wrote:I think you probably encounter this bug:

XmlLogger.LogData produces no output : Bug Reports