isVisibleWithinViewport() doesn't work on elements if viewport position is determined by element ID in URL #1758

elewandowski opened this Issue Dec 8, 2016 · 0 comments


None yet

2 participants


The problem

The method isVisibleWithinViewport does not seem to work on elements, if the page is scrolled to the element by an element ID at the end of the URL.


  1. I have a webpage at
  2. My viewport is 100x100
  3. I have an element with ID #HEADER, which is at position (0, 200)
  4. I go to
  5. The webpage scrolls down so the page is at (0, 200)
  6. I query my #HEADER element with isVisibleWithinViewport() and the method returns false

If I do the above but, instead of step 4, I scroll down using scroll('#HEADER') method (so the object is in view), and then call isVisibleWithinViewport(), it returns true.

Because of this, I presume there is some viewport variable in Selenium that is not updated when a page is moved to the location of an element, which is specified by an ID at the end of the URL.


  • WebdriverIO version: 3.10.3
  • Node.js version: 6.4.0
  • Standalone mode
  • list of all wdio packages used: webdriverio@4.4.0, wdio-selenium-standalone-service@0.0.5, wdio-phantomjs-service@0.1.0, wdio-cucumber-reporter@0.0.2, wdio-cucumber-framework@0.2.12

Link to Selenium/WebdriverIO logs

Code To Reproduce Issue [ Good To Have ]

I can provide sample code if necessary, but I would have to edit what I have so it's shareable.

@christian-bromann christian-bromann added this to the Upcoming milestone Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment