Issue with screenshot validation

Ranorex Spy, Recorder, and Studio.
Stu B
Posts: 5
Joined: Fri Oct 21, 2011 2:17 pm

Issue with screenshot validation

Post by Stu B » Tue Oct 25, 2011 3:08 pm

Hi
With a Ranorex trial (V3.1.1.14266)
Running on Windows 7 SP1

I need to validate that an image is correctly displayed in the application under test.
The image should contain 3 coloured areas (Shown in the actual expected image screenshot)
I captured a screenshot and have tried using both contains & compare image over the area of the image that I want to validate
The image similarity is set as 0.99
When I remove the lowest area and run the test I expect it to fail as the image is very different, the test still passes (Shown in the passed test screenshot)

Am I failing to setup the image validation correctly?

The screenshots are attached in a zip

Regards

Stu
Attachments
Image Validation.zip
(412.74 KiB) Downloaded 174 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Issue with screenshot validation

Post by Support Team » Tue Oct 25, 2011 5:40 pm

Stu B wrote:The image similarity is set as 0.99
It could be that the similarity is just too low. Please, try to increase the similarity to 0.999 or 0.9999.

The similarity takes pixel color values into account, i.e the maximum difference is a white to black; dark colors are more similar to black than light colors. The comparison computes a similarity value for each pixel according to the compared colors and sums up this similarity; it is not a number saying how many pixels were completely identical.
Consequently, if the only difference is a small dark spot (compared to black), the two pictures might still be 99% similar although less than 99% of the pixels have identical color.

Regards,
Alex
Ranorex Team
.
Image