Being a beginner in the world of Selenium, I am seeking guidance on the following issues:
1) What is the best way to automate scrolling on a webpage and make it stop when it reaches the height of the desktop? I need to capture screenshots of a full-screen webpage, so I want it to scroll automatically to a specific desktop height, take a screenshot, then continue scrolling to the same height again, taking another screenshot, and repeating this process until the end of the page.
2) How can I determine when the end of a page has been reached? Is it possible to use JavaScript's scrollTo method for this, or are there other methods available?