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.

2 comments:

Java Program 6: How to reverse a String in Java?

In this post we will discuss different methods to reverse a String in java programming. Method 1: Step 1: Read the input string using ...