Selenium: how to get specific point location

Last updated on:

You would use getLocation() when you need to find exact element location on the page.

WebElement component = driver.findElement(By.cssSelector("#cq-gen105"));

int x = component.getLocation().getX();
int y = component.getLocation().getY();

Here more detailed post how to perform click on element with specific coordinate.

View Comments

Leave a Comment

Use markdown or basic HTML and be nice.