-5

How to scroll down within a DIV and not in the whole Page via Selenium JAVA

1 Answers1

3

Use JavascriptExecutor

JavascriptExecutor js=(JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoView(true);", element);

But you need to explore various conditions under executeScript method.

Or,

You can use Action class if you require to move other element, org.openqa.selenium.interactions.Actions

Actions actions = new Actions(driver);
actions.moveToElement(element);
actions.perform();
Sanjay Bhimani
  • 1,593
  • 1
  • 15
  • 29