title: After Scroll Into View How can I get an element's new absolute coordinates in Selenium Java?
body: <p>Is there a way to return the new absolute co-ordinates of an off-screen element after it has scrolled into view?</p>
  
  <p>I've tried refreshing the element by extracting it's xPath</p>
  
  <pre class="lang-java prettyprint-override"><code>String xPath = generateXpath(this.currentElement, "");
  this.currentElement = driver.findElement(By.xpath(xPath));
  </code></pre>
  
  <p>Here is my current code:</p>
  
  <pre class="lang-java prettyprint-override"><code>//Output initial X, Y coordinates
  System.out.println ("X: "+  String.valueOf(this.currentElement.getAttribute("offsetTop")));
  System.out.println ("Y: "+ String.valueOf(this.currentElement.getAttribute("offsetLeft")));
  
  //X: 495
  //Y: 3109
  
  //Scroll object into view at the bottom of the page
  ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(false);", this.currentElement);
  this.currentElement.sendKeys(Keys.ARROW_DOWN);
  this.currentElement.sendKeys(Keys.ARROW_DOWN);
  
  
  //Output new absolute X, Y coordinates
  System.out.println ("X: "+  String.valueOf(this.currentElement.getAttribute("offsetTop")));
  System.out.println ("Y: "+ String.valueOf(this.currentElement.getAttribute("offsetLeft")));
  
  //Same as original coordinates
  //X: 495
  //Y: 3109
  </code></pre>
  
  <p>Expected results is the new absolute screen position</p>
  
  <p>X: 495
  Y: 997</p>