Bug reports.
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland


Post by atom » Tue Oct 13, 2009 3:53 pm


The Report.Screenshot method doesnt seem to make sure the item your taking a screen shot of is
Activated. I take screen shots of all error dialogs found during the test, and often the dialog is not
activated before the screen shot and so is only partially visible.


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

Re: Report.Screenshot

Post by Support Team » Wed Oct 14, 2009 10:50 am

You are right, Report.Screenshot does not call EnsureVisible on the element. This behavior is by design, because we don't want to influence the application by doing the screenshot. That way you can identify, for example, that not finding an element is caused by the fact that a dialog was not activated.

You can, however, use the following code for screenshots that will make sure that the element is visible:
// make screenshot of Element target and make sure the element is visible
Image screenShot = Imaging.CaptureImage(target);
Report.LogData(ReportLevel.Info, "ScreenShot", screenShot);
Ranorex Support Team