Skip to content

Instantly share code, notes, and snippets.

@dariayermolova
Created July 31, 2018 12:35
Show Gist options
  • Save dariayermolova/3529bcae47f81b5b4142af57f5ac7ddd to your computer and use it in GitHub Desktop.
Save dariayermolova/3529bcae47f81b5b4142af57f5ac7ddd to your computer and use it in GitHub Desktop.
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