Not sure if I'm even asking this question correctly, however, here goes.

I'm looking at validating images in an automation suite that I just started. I am currently validating the location via XPath and if the image is thereby ensuring that the URI matches a predefined string while checking to ensure that the image is returning either 200 or 304. Is there any way to actually match the image, however (I was kind of thinking file size, but there may be a better way).
I think that anyone who works on applications where code and content are handled by separate teams will understand the reason for this question.

  • are you looking for bit map comparison?
    – Tarun
    Commented Jun 3, 2011 at 15:50
  • Sorry about the late reply Tarun. I'm honestly really not certain what I'm looking for as I'm not completely certain on what the best way to do this would be. If I was doing this manually, yes I would be comparing the the actual image. I understand though that this may not be a great practice programmatically. Commented Jun 6, 2011 at 5:06

2 Answers 2


For image comparison I could suggest to use - captureScreenshotToString. So you could keep one copy as reference point while other captured run time and then comparing it with already saved copy. But as you said it is not "great practice programmatically."... Also you would have to simulate selenium 1 to use captureScreenshotToString api from selenium 2. For more on this look here - http://seleniumhq.org/docs/03_webdriver.html#emulating-selenium-rc


SIKULI is a visual technology to automate and test graphical user interfaces (GUI) using images (screenshots). It stores the elements it comes across on the page in the form of bitmaps. It can be used for testing/comparison of images. Find more at http://sikuli.org/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.