Created
January 23, 2017 12:28
-
-
Save santhoshv339/9b92fadd2879a5d14b548e72cd5b5083 to your computer and use it in GitHub Desktop.
Scroll by given pixel Offset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//To scroll down web page by 900 pixels In x(vertical) direction. | |
//You can y parameter to scroll page In horizontal direction. | |
JavascriptExecutor javascript = (JavascriptExecutor) driver; javascript.executeScript("window.scrollBy(0,900)", ""); | |
//To scroll up web page by 300 pixels In x(vertical) direction. | |
javascript.executeScript("window.scrollBy(0,-300)", ""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment