Perform an Image Comparison in Code
I would like to compare a specific image from the browser to one stored on disk.
Solution
Here is sample code showing how to perform an image comparison:
In the above code I am getting the image of the "myImageId" element from the browser and comparing it to the expected image stored on disk named "myExpected.png". The comparison is allowing a 5% tolerance, meaning there may be up to a 5% difference in the image or else the Assert fails and the test aborts.