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
- find an element based on Xpath
- capture the image(element)
- 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.
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?
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.
I was able to achieve UI verification by writing a keyword for Ocular - https://github.com/vinsguru/ocular
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.
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.