How to find broken or invalid images on a webpage
using WebDriver? Part 1
There are several ways to accomplish this. Let's discuss
one of the easiest available ways. I will keep update the other solutions regard to the
same in my next posts..
Solution
Statement:
To check if an image is broken, you can simply
check if the naturalWidth of
the element is 0. You would loop through the images on
the page and do this check for each. As for doing this across an entire site,
you would have to build a crawler or ideally find an existing one and that's
out of scope for a question on SO.