Consider the following scenario,
- The webpage is displayed along with a vertical scroll bar
- Scroll bar is present at the bottom
- WebElement 'Test' is present at the top of the page and is now not visible in the current view port.
Functionality to be verified:
Clicking 'Goto Top' link in the bottom of the page should scroll the page such that the WebElement 'Test' gets displayed within the view port.
Please let me know how to verify whether an element is displayed in the current view port or not using WebDriver.
Note: element.isDisplayed will always be true in the above case as the function checks the whole page rather than checking the current view port only.