How to compare two images in Ranorex

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

How to compare two images in Ranorex

Post by premravi » Thu Apr 25, 2019 1:40 pm

Hi,

The scenario is
1. login to application
2. perform some action
3. It will display one image in the screen
4. capture screenshot
5. logout
6. login again
7. The image should be there in the main screen (this is the business requirement)
8. Now compare the two images
Expected : The previous and current image should be same

Please find the attached screenshot and snapshot both
Attachments
Canvas-Drawing-Canvas.rxsnp
(144.69 KiB) Downloaded 7 times
compare images.png
compare images.png (873.78 KiB) Viewed 349 times

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

Re: How to compare two images in Ranorex

Post by Stub » Thu Apr 25, 2019 2:46 pm

Code: Select all

Ranorex.Unknown element;
Bitmap expected_image;
Imaging.FindOptions find_options;
Validate.Options validate_options;
String description;

Ranorex.Validate.CompareImage(element, expected_image, find_options, description, validate_options);

premravi
Posts: 78
Joined: Tue Jan 08, 2019 1:55 pm

Re: How to compare two images in Ranorex

Post by premravi » Tue Apr 30, 2019 11:16 am

Hi,

Thanks for your response,

As I shared the snapshot and screenshot, can you please help me with the values I have to enter in the place of these parameters what we are passing in here:

Ranorex.Validate.CompareImage(element, expected_image, find_options, description, validate_options);

Basically, in place of element, expected_image and so on........

Regards