I would like to validate an image generated by the web server I am developing. I want to check the image layering is correct by finding out what colour a particular pixel in the image is. The image is contained by an with the background-image attribute set to a URL that returns that image. I have seen several mentions of using a screen capture to get the actual image but I wondered if there is a way to get only the image rather than the entire web page.
Can you:
do a screen capture on a WebElement
extract the bytes the image comprises of
or is there some other way?
Try aShot Util it allows to take screenshot of webelement and convert it to byte array.