Is there a way to retrieve the height and width of an image after it has been resized for a view? I have images that may vary in original dimensions, but users can resize them as needed.
For example, this code from the console gives the client height:
document.getElementsByClassName("WiderImage")[0].clientHeight
Can someone assist me in capturing this value and storing it for validation with Selenium?
I attempted the following approach, but it resulted in null:
JavascriptExecutor js=(JavascriptExecutor) driver;
String x =(String) js.executeScript("document.getElementsByClassName('imageWiderThanText')[0].clientHeight;");
long client_height = (Long) js.executeScript("document.getElementsByClassName('imageWiderThanText')[0].clientHeight");