Image Verification

Webdriver and Image Verification

Can you do image verification if it loaded on webpage?

 Yes! You can verify but you cannot say that images are half loaded. To verify if image is correct then there would be some other method but code will tell you just that images are loaded on page or not.

You can send http request to that source using GET method and check the status code as 200. if that the case then your image downloaded properly and image is there. 

Please drop your comments if you think if I am missing anything. If you have other idea to do image verification, please post in comment.

16 thoughts on “Webdriver and Image Verification

  1. HI everyone,
    Regarding verification of the downloaded pdf content, i would like to share my current working with you guys,.Well i am writing the automation framework with MySQL support in selenium RC java now a days.I also have to find the solution where we can compare or verify the downloaded pdf content with our verification points. . So after thinking a lot and studying the selenium API, i come to the decision that we need to introduce a parser here with the help of some java code which can help in the situation. Well i am not sure if it works or not, I am still under progress of some kind of POC. You can also think on these lines. May be this will resolve your problem.

    1. I am kind of agree with you but we should keep in mind that verifying image or pdf is not under scope of Selenium but programming language whatever we are using.

  2. In order to do visual verification, you can use ‘Microsoft.Test.VisualVerification’.
    All you need to do is have a copy of the expected image and then click a snapshot of the browser and get the actual image and then use VisualVerification to assert your results.

    This technique is very reliable and you can also set tolerance levels if required to assert your result.
    Hope this is helpful, mail me if you require any assistance with Visual Verification.

    1. Hi Abdullah,
      What kind of region are you talking about? If you like to verify inside image then not possible but you just want to verify image as a whole then you are good to go and use above or similar code. Let me know if you were asking something different.

Leave a Reply

Your email address will not be published. Required fields are marked *