Screenshot on report

Ask general questions here.
wyll
Posts: 34
Joined: Wed Aug 01, 2012 3:19 pm

Screenshot on report

Post by wyll » Tue Aug 21, 2012 12:53 pm

Hello,

sometimes on my report log screenshots are shown on failure, sometimes it doesnt.
Can you please tell me if there some settings that will change that?

i have that take a screenshot for every step activated, but sometimes when i have those log failures screenshot doesnt show up.

also added a Report.Screenshot() and suddenly i have 2 of the same screenshots in my report log


regards,
wyll

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

Re: Screenshot on report

Post by Support Team » Tue Aug 21, 2012 3:32 pm

Hello wyll,

Which Ranorex version are you using, could it be that you use the old reporter(xsl) from 2.3.X?
Can you determine the circumstances when the screenshot doesn't show up?
Normally there should always be a screen shot when a failure is reported.

Regards,
Markus
Ranorex Support Team

wyll
Posts: 34
Joined: Wed Aug 01, 2012 3:19 pm

Re: Screenshot on report

Post by wyll » Tue Aug 21, 2012 3:54 pm

hello markus,

i use the newest ranorex version 3.3.1, hmm not sure which reporter i use, but i guess you mean this in my folder "RanorexReport3"

no idea tough about when screenshot doesnt show up. Have done everything as before, it just happened recently that my Failures doesnt show screenshots.

what i basically have is

Code: Select all

if(Ranorex.contains(my element, my bitmap)
{
       Report.success("Success");
       report.screenshot(my element);
}
else
{
      report.failure("fail");
}

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

Re: Screenshot on report

Post by Support Team » Wed Aug 22, 2012 12:23 pm

Hello,

Do you mean that the screenshot from the Report.Screenshot method is not shown or really from the Report.Failure?
There is an issue with the Report.Screenshot method, but this should be fixed with 3.3.2.
Meanwhile you can use the following code:
Just enable append existing with XmlLogger:
XmlLogger.AppendExisting = true;

//If the behavior is not desired expect using screenshots you can set it before and reset after capturing a screenshot. 

XmlLogger.AppendExisting = true;
Report.Screenshot();
XmlLogger.AppendExisting = false;
Does this solve the issue?
If not could you upload such a report with the not shown screenshots?

Regards,
Markus
Ranorex Support Team

wyll
Posts: 34
Joined: Wed Aug 01, 2012 3:19 pm

Re: Screenshot on report

Post by wyll » Wed Aug 22, 2012 1:43 pm

Hello,

yes its really from the Report.Failure
Report.Screenshot works just fine for me.

also witnissed the same with Report.Warn
sometimes it makes a screenshot,
sometimes not.
x = Mouse.Position.X;
        	y = Mouse.Position.Y;
        	Point p1 = new Point(x,y);
        	Point p2 = new Point((x+150),y);
       		Mouse.ButtonDown(WinForms.MouseButtons.Left);
        	
        	Mouse.MoveTo(p2);
        	Mouse.ButtonUp(WinForms.MouseButtons.Left);
        	Delay.Duration(2000);
        	Mouse.Click(p1);
        	Delay.Duration(2000);
        	Report.Warn("#5 Testcase: yoyoyo");
        	Report.Screenshot(self);
        	
        	
        x = Mouse.Position.X;
        	y = Mouse.Position.Y;
        	p1 = new Point(x,y);
        	p2 = new Point(x,y+250);
        	Mouse.ButtonDown(WinForms.MouseButtons.Left);
        	Mouse.MoveTo(p2);
        	Mouse.ButtonUp(WinForms.MouseButtons.Left);
        	Delay.Duration(2000);
        	Mouse.Click(p1);
        	Delay.Duration(2000);
        	Report.Warn("#6 Testcase: yoyoyo");
        	Report.Screenshot(self);
regards wyll

EDIT: sorry changed the message in the report.warn after making the Reportscreenshot, but i think this isnt such a big of a deal.
You do not have the required permissions to view the files attached to this post.

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

Re: Screenshot on report

Post by Support Team » Thu Aug 23, 2012 5:14 pm

Hello,

Thanks for showing us the report.
Is the code executed on a VM or could it be that the screen gets black?
Are you working on the machine when the test is executed?
Please un-check the "Use hidden screenshot capturing" checkbox in the "Advanced" section of the "Global Settings" window, does this solve the issue?

Regards,
Markus
Ranorex Support Team

wyll
Posts: 34
Joined: Wed Aug 01, 2012 3:19 pm

Re: Screenshot on report

Post by wyll » Fri Aug 24, 2012 1:03 pm

hello,

yes its running on a VM,
sorry i cut out the screenshots for safety reason.


hmm very wierd, ran the same exact code today again with the same settings as always and no SS popped up at the warn log.
i can't reproduce it anymore.
Failures does its screenshot....
warn message does not...
looks like it was a bad day for screenshots. :roll:

regards
wyll

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

Re: Screenshot on report

Post by Support Team » Fri Aug 24, 2012 2:26 pm

Hi,

A restart can be helpful in some cases :lol: .

Regards,
Markus
Ranorex Support Team

wyll
Posts: 34
Joined: Wed Aug 01, 2012 3:19 pm

Re: Screenshot on report

Post by wyll » Wed Sep 26, 2012 12:47 pm

Hello again,

i encountered the same problem as before, but this time its with the Report.Success();
sometimes does a screenshot, sometimes it doesnt. :?

And the code below is used for all testcases
if(condition == true)
{
Report.Success("blabla");
Report.Screenshot(element);
}
EDIT: PS.: a restart didnt help this time :P
You do not have the required permissions to view the files attached to this post.

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

Re: Screenshot on report

Post by Support Team » Thu Sep 27, 2012 2:42 pm

Hello,

That is a very weird issue, do you see the issue with the current Ranorex version 3.3.2 or with the older 3.3.1 one?
Could you add for test purposes a delay of about 500ms between the two methods, did this change anything?

Regards,
Markus
Ranorex Support Team

wyll
Posts: 34
Joined: Wed Aug 01, 2012 3:19 pm

Re: Screenshot on report

Post by wyll » Tue Oct 02, 2012 10:36 am

Hello again,

I still use the 3.3.1 Ranorex version. Will update to 3.3.2, when the one responsible for that is back in the office (he's on vacation :roll: )

tbh this issue happens sporadically.
Tried to run the same test twice. on the first it appeared. On the second it doesn't.
Could not try to put a delay inbetween. Will inform as soon i have the chance again.

Yes a very wierd issue....hmm

For my never tests i generally changed the code to
Report.Screenshot(ReportLevel.Success, "blabla", "blabla", element, false)
regards,
Wyll

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

Re: Screenshot on report

Post by Support Team » Tue Oct 02, 2012 4:14 pm

Hello,

Could it be that a test step failed when you see the issue in the reports?
Normally such tracing screenshots are just shown when a test step failed.
You can also disable the "Capture Tracing Screenshots" option in test suite properties window, this should ensure that no screenshots for such report methods are displayed, because normally there should be no screenshots when you just log a Warning, Info, Success..., except there was a failure then the last three report messages would show a small tracing screenshot.

Regards,
Markus
Ranorex Support Team