In this post I have explained that how to verify images in
webdriver using java. As webdriver does not provide direct any function to image verification, but we can verify images by taking two screen shots of whole web page
using “TakesScreenshot” webdriver function, one at script creation time and another
at execution time,
In below example I have created a sample script in which first I
captured a Google home page screen shot and saved (GoogleInput.jpg) into my
project, Another screen shot “GoogleOutput.jpg” captured of same page at test executing time and saved into project. I compared both images if they are not same then test will script fail.