image, element comparison

About image comparison to verify whether the page is right or not

I ran a test case after putting a object’s image path its own and using two function, “wait for image present”, “verify image present”
The exepected image and result image were different but it was not fail but success.

These are my questions.

  • the regular process of image comparison
  1. find an element based on Xpath
  2. capture the image(element)
  3. show ‘success’ if the captured image and the original image are 100% matched by pixel
  • If I understand right, what am I supposed to do to fix this problem?

I’ve successfully used http://www.frontendtest.org/blog/screenshot-comparison/ to do image comparisons. It was simple to integrate with Katalon and does a fuzzy compare of the images.

1 Like

Thank you for your considerable answer!!! Let me read that page first.

Actually, we are using Sikuli framework to compare the images. Based on the official answer about the matching pattern, they compare each pixel of the original image with the actual image that will generate a score from 0.0 to 1.0. If the total scores are acceptable (>=75%), the image presents on the page.

Thank you for your answer. I have one more question about this.

I want to know the way how Katalon compare the original image and the actual one.

Is it done by pixel or any other way?

Thank you!

Hi Kim,

Verify Image Present only check the image of the object that presents on the current page or not. The keyword is passed if the actual image are matched >= 75% compared with the original image.

Thanks.

1 Like

I was able to achieve UI verification by writing a keyword for Ocular - https://github.com/vinsguru/ocular

Hi @Akshay Vasava is it possible to paste that keyword you made to this post or send it to me private? I would like to make a Visual testing using Katalon. So far I was able to create custom defined keyword with Ashot javascript library, so that it takes a screenshot of the “entire” web page automatically by following this post : http://forum.katalon.com/discussion/2488/how-to-take-a-full-page-screenshot-of-mobile-pc

But the 2nd step would be to compare this screenshot to another of the same web page taken earlier to see if there are differences or not. So if I can have an example of custom keyword using ocular would be grateful. I have limited programming knowledge at this moment, but I am learning. :slight_smile:

Thanks in advance!

Do you have sample Test Case how to use the script?
I do not know coding so it is hard for me to understand how to call this script into a Test Case.

thanks