I attempted to scroll downwards in my application's window using the following JavaScript code:
((JavascriptExecutor) driver).executeScript("windows.scrollBy(0,500)");
Additionally, I tried to ensure a specific element is in view with this script:
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView();", element);
Finally, I attempted to scroll to the last element on the page as shown below:
WebElement lastElement = driver.findElement(By.xpath("value of locator"));
int y = lastElement.getLocation().getY();
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("window.scrollTo(0,"+y+")");
Thread.sleep(3000);
Although the window's scroll bar moved down successfully, my intention was to scroll within the application's scroll bar itself. https://i.sstatic.net/Xx07H.png
Referring to the attached image, after clicking on settings, it opened additional options that required scrolling to access the content below.