How to take screenshot in Ranorex

Ask general questions here.
premravi
Posts: 128
Joined: Tue Jan 08, 2019 1:55 pm

How to take screenshot in Ranorex

Post by premravi » Thu Apr 11, 2019 12:42 pm

Hi,

I want to take the screenshot of the final validation step of my test case in run time and save that in a specific path and compare it

Please help me in this issue

Regards

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: How to take screenshot in Ranorex

Post by Stub » Fri Apr 12, 2019 7:55 am

Try these APIs:

Code: Select all

Bitmap bmp = Ranorex.Imaging.CaptureDesktopImage(element);
CompressedImage image = new CompressedImage(bmp, ImageFormat.Png);
or:

Code: Select all

CompressedImage image = Ranorex.Imaging.CaptureCompressedImage(element);
Then save it:

Code: Select all

CompressedImage image =  ...(element);
image.Store(filename);