My current project involves a unique challenge where there is a specific div element on the webpage that acts as a popup dialog when a link is clicked (similar to Facebook reaction dialog boxes).
To automate tests for this scenario, I am using Selenium WebDriver with Java. The task at hand requires me to scroll to the bottom of the dialog box where there is a "Show More" link. Clicking this link loads an additional 10 items in the list, and this process continues until all items have been displayed.
The challenge lies in continuously scrolling down within that specific div element to locate the "Show More" link. If the driver cannot find the link, the scrolling should stop.
It is important to note that a simple JavaScript `window.scrollTo()` function cannot be used to scroll to the bottom of the whole page; rather, the goal is to scroll only within that particular division element.
If anyone has any suggestions or solutions on how to achieve this step-by-step scrolling within the div element, please share your insights.
Thank you in advance for your assistance!