How to scroll web page UP or Down using Selenium WebDriver?

UI Test Automation.

How to scroll web page UP or Down using Selenium WebDriver?

3 minutes readKey takeaways Scrolling is done through the JavaScript executor, since WebDriver has no native scroll command. scrollIntoView is more reliable than pixel offsets, which break on different viewports. Scroll before interacting with anything below the fold or the click may miss. If you want to scroll the page UP or DOWN with Selenium WebDriver in… Read more »

How to Clear Local Storage using Selenium WebDriver?

UI Test Automation.

How to Clear Local Storage using Selenium WebDriver?

2 minutes readKey takeaways Clearing cookies does not clear local storage, so state survives between tests. Execute localStorage.clear() through the driver's JavaScript executor. Do it in setup rather than teardown, so a crashed test cannot leak state into the next. There are two options to interact with browser’s local storage: via javascript by creating your own methods… Read more »