Image based validation fails

Ask general questions here.
anouar2002
Posts: 38
Joined: Thu Feb 27, 2020 2:06 pm

Image based validation fails

Post by anouar2002 » Wed Nov 24, 2021 1:48 pm

Hello everyone,

The image base validation fails on my side because of difference between the actual image and the expected one.
I am using the ContainsImage attribute to validate a part of the image that exists. The validation shouldn't fail because there is no difference between the two images.
The problem that Ranorex takes another image of my AUT as an actual image. For example:
I want to test if Ranorex Logo exists in the home page banner:

Homepage banner :
https://imgur.com/a/ajSSRcn

Expected image:
https://imgur.com/X8wuMde

Actual image:
https://imgur.com/CI3Okns

Jacob
Certified Professional
Certified Professional
Posts: 120
Joined: Mon Mar 22, 2021 10:01 pm

Re: Image based validation fails

Post by Jacob » Wed Nov 24, 2021 5:07 pm

Hi anouar2002,

I would recommend that you double-check the image editor settings for the comparison screenshot. It seems to me that there may be some part of the banner that is selected in such a way that is causing Ranorex to look at the incorrect area of the banner.

--Jacob
Image

anouar2002
Posts: 38
Joined: Thu Feb 27, 2020 2:06 pm

Re: Image based validation fails

Post by anouar2002 » Thu Nov 25, 2021 10:24 am

Hi Jacob,

Thanks for your reply.
I am using the image editor to select the part of image that I want to validate it. The problem that Ranorex take another part of AUT as actual image which is differenrt from the selected desired image part.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Image based validation fails

Post by odklizec » Thu Nov 25, 2021 12:23 pm

Hi,

Please make sure the display scale is set to 100%. This is extremely important, when it comes to image-based actions ;) Image offset usually indicates that the display scale is set to higher value than 100%.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

anouar2002
Posts: 38
Joined: Thu Feb 27, 2020 2:06 pm

Re: Image based validation fails

Post by anouar2002 » Thu Nov 25, 2021 3:19 pm

Hi Pavel,

Thanks for your reply.

My display scale is set to 100%. I don't know why Ranorex takes a screenshot from another part of the AUT.