Forum Discussion

ppfeifer's avatar
ppfeifer
Contributor
5 years ago

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! 

  • 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-pictures.html  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. 

    • ppfeifer's avatar
      ppfeifer
      Contributor

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

    • ppfeifer's avatar
      ppfeifer
      Contributor

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

      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        Thank you hkim5 for such valid advice!

         

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

  • jr348's avatar
    jr348
    Contributor

    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.

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thanks, everyone!

      Thank you for sharing your experience with us jr348 !  ppfeifer Do you think you could try doing something of the kind in your scenario?