TestProject Forum
Powered by leading experts in the test automation community

Selenium java Scroll page Down is not working

hi ,

I am trying to Scroll the page down using the below java script code but the below code does not get Executed and it moves to next step . I have tried below ways.Please can you help me out I got stuck at this point.

((JavascriptExecutor)driver).executeScript(“scroll(0,2000)”);

((JavascriptExecutor) driver)
.executeScript(“window.scrollTo(0, document.body.scrollHeight)”);

Actions actions = new Actions(driver);
//actions.keyDown(Keys.CONTROL).sendKeys(Keys.END).perform();

use this for scroll down :
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript(“window.scrollBy(0,250)”, “”);

Do try this for selenium webdriver 2,
selenium.getEval(“scrollBy(0, 250)”);
Hope it will be helpful for you.Allow me to introduce about choosing the right platform for your app and finding the best testing strategies.To know more:https://bit.ly/2Jh7Dxn