Saturday, November 18, 2017

How to get Coordinates, Width, Height and Size of the WebElement using Selenium WebDriver?

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.

1 comment:

DevOps 01: What is DevOps and How it benefits organizations?

DevOps is a culture in an organization, where the development team and operations team help each other by sharing information, process and t...