cancel
Showing results for 
Search instead for 
Did you mean: 

Use Image checkpoint to test for an empty region

SOLVED
Highlighted
Occasional Contributor

Use Image checkpoint to test for an empty region

I have an area on my web page to test, which is basically a representation of a chart with a line overlay.

 

The curve of the line will vary, depending on the source data I am pulling into the web page, so I can't do an exact image map for the curve as a test. Really, all I care about is that there is a curve there, within a static defined rectangular region on the web page.

 

Is it possible for me to manually clean up a copy of this region with no line inside it, and do a test where, if it looks like this manually edited blank image, the test fails?

--
You might not like AI, but it doesn't care about you.
1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Use Image checkpoint to test for an empty region

The picture without the curve is your "baseline".  The "mask" file is as separate image consisting only of white and black spaces, the white space being what you want to compare, the black being what you want to have ignored.


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
6 REPLIES 6
Community Hero

Re: Use Image checkpoint to test for an empty region

What happened when you tried it?

Occasional Contributor

Re: Use Image checkpoint to test for an empty region

I don't know how to do it...

--
You might not like AI, but it doesn't care about you.
Community Hero

Re: Use Image checkpoint to test for an empty region

You're going to want to use the "Mask" feature of image comparison.  You're going to have a baseline object with a blank screen.  You're going to apply the mask.  If the result of the Compare method returns "false", then you have a curve in the region.  If it returns true, then the regions match meaning it's blank.

 

See https://support.smartbear.com/testcomplete/docs/reference/program-objects/picture/compare.html


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
Occasional Contributor

Re: Use Image checkpoint to test for an empty region

So can I add an edited picture with no curve to my project, and build the mask off that?

--
You might not like AI, but it doesn't care about you.
Community Hero

Re: Use Image checkpoint to test for an empty region

The picture without the curve is your "baseline".  The "mask" file is as separate image consisting only of white and black spaces, the white space being what you want to compare, the black being what you want to have ignored.


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
Occasional Contributor

Re: Use Image checkpoint to test for an empty region

OK. I'll go search the help files and raise a ticket with support if necessary after I've played around with this. Thanks all.

--
You might not like AI, but it doesn't care about you.
New Here?
Join us and watch the welcome video:
Join the September Hub-bub to show off, learn and win