How to get the x, y-axis location of the view itself in selenium?

I know I can get the position of a specific element. But I can't find a way to get the coordinate of the window's view itself. So I can see it change as a scrolling/click action in the page happened.

Are there ways to do that in Selenium?

I uses wd.js

closed as off-topic by Michael Durrant, alecxe, IAmMilinPatel, Bharat Mane, NarendraC Jul 20 '17 at 12:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development unrelated to testing are off-topic here, but can be asked on Stack Overflow." – Michael Durrant, alecxe, IAmMilinPatel, Bharat Mane, NarendraC
If this question can be reworded to fit the rules in the help center, please edit the question.


I am using the below snippet:

Point point = element.getLocation();

int x_co_ordinate = point.getX();
int y_co_ordinate = point.getY();

System.out.print(x_co_ordinate + ", " + y_co_ordinate);
  • it's more about view rather than the element itself. thanks – Ezeewei Dec 20 '16 at 16:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.