cancel
Showing results for 
Search instead for 
Did you mean: 

Compare logos on pages

SOLVED
Highlighted
Occasional Contributor

Compare logos on pages

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! 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

Re: Compare logos on pages

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.

View solution in original post

17 REPLIES 17
Highlighted
Staff

Re: Compare logos on pages

you can first add in those three approved logos into the Stores test item as a region artifact. 

hkim5_0-1599681586629.png

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. 

Best,
Justin Kim
Highlighted
Occasional Contributor

Re: Compare logos on pages

I will give this a try!  Thanks.  I will will let you know how it comes out.   

Highlighted
Occasional Contributor

Re: Compare logos on pages

Also, the location on the webpage can be anywhere.  I was having some difficulty with searching the entire page for the logo object.   

Highlighted
Community Manager

Re: Compare logos on pages

Thank you hkim5 for such valid advice!

 

@ppfeifer Did you get the chance to test out this approach yet?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

Re: Compare logos on pages

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.

Highlighted
Community Manager

Re: Compare logos on pages

@Wamboo @Marsha_R @abishekhari007 @tristaanogre your advice would be greatly appreciated🙂


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Community Hero

Re: Compare logos on pages

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.

 

 

Highlighted
Occasional Contributor

Re: Compare logos on pages

They are a image: 

<img src="/documents/111597/1813862/FS_WebBanner_FLCatalog_700x100_2020.png/80e2755e-9c61-baa7-4679-8b274f55708f?t=1594737041457">

 

That is one of them that I am looking for,  

 
 

 

Highlighted
Community Hero

Re: Compare logos on pages

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.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors