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 an image is correct then there would be some other method but the code will tell you just that images are loaded on the 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 an image is there. 

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

19 Replies to “Webdriver and Image Verification”

      1. Is it possible to read un-rendered content and perform action on it? For Ex.) I have a table with 100 columns in which the grid first displays only 50 columns and upon scroll only the other remaining columns will be displayed. So here first 50 columns and rows only visible in the DOM, the remaining will be visible in the grid only if user scrolls right/left.? Please let me know the feasibility of this using selenium or any other automation tool.

  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.
    [email protected]

    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 *