Ask a Question

Unable to get masking to work when comparing Images

New Contributor

Unable to get masking to work when comparing Images

Dear Team,


I am currently working on a test where an image appears on the screen with some text on it (ExpectedImage). The background of this image can vary depending on different states of the system. I am only interested in the text present irrespective of the background color. Hence I created a monochrome mask image (MaskImage). When the image appears on the screen during the course of the test (ActualImage), I expected it to pass due to the use of mask picture. But the test fails with the difference in images shown as in DifferenceImage. 


Can any one please help me understand why this is failing ? Is my understanding of usage of masking incorrect ?





(Attached project with the images as described in the issue)



Esteemed Contributor

The second parameter which indicates "transparency" (see you have set to true.  Set that to false.  I had a similar issue when using a mask.  That ONLY applies when you actually have a "transparent" background in your main image.  Everything else SHOULD work.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi Robert,


Thanks for the response. I did try by setting the transparency parameter to false, but it still did not work. I had raised the same with the support team and have received a response as to the masked image having contour pixels in it (its visible when zoomed to 800%). I have decided to make use of Transparent images (so no background) and that is working. 




SmartBear Alumni (Retired)

Hi @dhagal,

I'm happy to hear that the question is resolved. I've marked your reply as a solution so that other members could find the answer faster!

Tanya Yatskovskaya
SmartBear Community and Education Manager

Showing results for 
Search instead for 
Did you mean: