I need to implement a scroll function for a table on my webpage rather than scrolling the entire page, so using window.scrollBy
is not an option.
After attempting to find the container responsible for the scroll functionality in the DOM (with no luck), I decided to use the following code:
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("arguments[0].scrollBy(0,200);",scrollContainer);
(Where ScrollContainer is of type WebElement)
However, this has resulted in an exception being thrown:
org.openqa.selenium.WebDriverException: unknown error: arguments[0].scrollBy is not a function
Could someone please advise on what might be going wrong in my implementation?
Thank you.