Not able to scroll down page using Selenium webdriver



  • I want to scroll down a page that is coming inside a form, not on the main page.

    I tried this code:

    JavascriptExecutor jse = (JavascriptExecutor)driver;
    jse.executeScript("window.scrollBy(0,250)", "");
    

    enter image description here

    The above code is not able to pick the scroll bar as it is not in the main page



  • Please use below code.

    driver.get("http://www.flipkart.com/");
    driver.manage().window().maximize();
    driver.findElement(By.linkText("Trimmer")).click();
    WebElement scroll = driver.findElement(By.id("brand"));
    scroll.sendKeys(Keys.PAGE_DOWN);
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2