-1

I want to scroll a specific division in selenium java enter image description here

As you can see in the picture there are two divs, by default the left one has the scroll thing so if u scroll it scrolls in that

I want to scroll in the division on the left but I cant set focus to it by clicking something in it cause that makes it go to another page.

Thanks

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95

1 Answers1

0

Please try following code,

/*
 * By
 * scroll to the element and wait
 */
public void scroll(By element) {
    JavascriptExecutor js = (JavascriptExecutor) driver;
    js.executeScript("arguments[0].scrollIntoView(true);", driver.findElement(element));
    log.info("Scrolling down");
    wait_for_("scroll");
}
Jayanth Bala
  • 758
  • 1
  • 5
  • 11