Created
July 31, 2018 12:35
-
-
Save dariayermolova/3529bcae47f81b5b4142af57f5ac7ddd to your computer and use it in GitHub Desktop.
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
public boolean scrollPageDown() { | |
JavascriptExecutor executor = (JavascriptExecutor)driver; | |
executor.executeScript("window.scrollBy(0,250)"); | |
boolean scrollResult = (boolean) executor.executeScript { | |
"var scrollBefore = $(window).scrollTop();" + | |
"window.scrollTop(scrollBefore, document.body.scrollHeight);" + | |
"return $(window).scrollTop() > scrollBefore;"}; | |
return scrollResult; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment