cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get masking to work when comparing Images

SOLVED
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 ?

 

Thanks

Dhagal

 

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

 

 

3 REPLIES
Community Hero

Re: Unable to get masking to work when comparing Images

The second parameter which indicates "transparency" (see https://support.smartbear.com/testcomplete/docs/reference/program-objects/picture/compare.html) 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
[Community Expert Group]
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
Extensions available
New Contributor

Re: Unable to get masking to work when comparing Images

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. 

 

Thanks

Dhagal

Community Manager

Re: Unable to get masking to work when comparing Images

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 Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
2018 NEWS
Top Kudoed Authors