Selenium WebDriver provides Point class in org.openqa.selenium package. Using Point class we get the location and coordinates of the given element.
And using getSize() method that is available in the WebElement interface we can get the width and height of the given WebElement.
In the below example you can see how to get the x,y coordinates, width, height and size of the web element.
And using getSize() method that is available in the WebElement interface we can get the width and height of the given WebElement.
In the below example you can see how to get the x,y coordinates, width, height and size of the web element.
Thanks Praveen :)
ReplyDelete