We have 40 institutions websites that must display 1 of the 3 approved logos. Additionally, they have 2 pages on their website to place the logo. So what that means is we have to check both known locations for the 1 of the 3 different possible logos and mark them in-compliant only if a logo doesn't display on one of the 2 pages.
To begin with, not sure how to compare the images. We have the 3 logo images on our website. Can 3 separate checkpoints be used to compare and still only log 1 error message if none exist on either page?
Can 3 different IF Objects be utilized in a loop to check for the 3 logos?
Not sure of the best way to proceed.
Is there a way to compare images from 1 website to another or can the images from our website be stored in the keyword test and then compared to the institution websites for 1 o exist?
I am still an intermediate level TestComplete user and I have not been successful in setting up this keyword test.
Any help will be appreciated!
Solved! Go to Solution.
I had a similar problem a few years ago looking for certain icons in a map that could not be spied..
We stored the icons as images in the images store.
Took a bitmap snap shot of the page object/map.
Did an image find within the snaps shot.
If it was found then record certain info about it like top-left, bottom-right coordinates etc. This allowed us to click it and do stuff.
It was slow though..
Cant remember the exact coding but that was the general idea.
you can first add in those three approved logos into the Stores test item as a region artifact.
then you would essentially be looping through those 40 websites, and do either a region checkpoint or the compare pictures operation https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/checkpoints/compare-pictur... in order to raise warnings/errors as needed.
you can have the region checkpoint, or the compare operation to grab the on screen logo (object) and compare it against the Stores item (containing the actual logo). Now iterating through the 40 websites sounds like a for or while loop, and check the two different on screen object locations for the three different approved logos sound like an if or try/catch statement.
Also, the location on the webpage can be anywhere. I was having some difficulty with searching the entire page for the logo object.
Thank you hkim5 for such valid advice!
@ppfeifer Did you get the chance to test out this approach yet?
I added them to the stores. When I did a compare, I had to give a location on the page. The logo is not in a fixed location on the page. It can be anywhere. So I was trying a different approach, make each logo a variable and check on the alias browser/page and use the if object is visible. I couldn't figure out how to do it with the picture compare and region checkpoint.
maybe something like this
have variables for FoundLogo1, FoundLogo2, FoundLogo3 all set to zero (start state = no logo found)
for page = 1 to 2
look for logos
if logo found
compare to saved logos, if match, set matching variable to 1
after both pages checked, if FoundLogo1 + FoundLogo2 + FoundLogo3 >= 2, then logos pass, else logos fail
For searching for the logos, do they have a distinct file type like .png or something? Maybe do a FindChild or something similar for that file type starting at the top of the page.
They are a image:
That is one of them that I am looking for,
Okay, I see in there that it's a .png file. Take a look at that image with Object Spy on one of those webpages and post the results here please.