Selenium java Scroll page Down is not working.

  • 2 Replies
  • 2007 Views
Selenium java Scroll page Down is not working.
« on: June 19, 2017, 10:30:08 am »
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();

Re: Selenium java Scroll page Down is not working.
« Reply #1 on: January 29, 2018, 12:54:05 pm »
use this for scroll down :
JavascriptExecutor jse = (JavascriptExecutor)driver;
 jse.executeScript("window.scrollBy(0,250)", "");

Re: Selenium java Scroll page Down is not working.
« Reply #2 on: June 29, 2018, 08:27:06 am »
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

 

Sitemap 1 2 3 4 5 6 7 8