Scroll Down Utility
Step 1:
Create a method scrollDown
Step 1:
Create a method scrollDown
public void scrollDown(int iter) throws InterruptedException{
JavascriptExecutor jse = (JavascriptExecutor)driver;
for(int i = 1;i<=iter;i++){
Thread.sleep(1000);
jse.executeScript("window.scrollBy(0,3000)", "");
Thread.sleep(1000);
}
}
Step 2:
Call the method when ever you want to scroll.
scrollDown(1);
No comments:
Post a Comment