I am using Selenium WebDriver to automate my browser tests. My browser header is floating and is always present irrespective of the browser scroll.
Scroll to top can be done:
private void scrollToTop() { JavascriptExecutor js = (JavascriptExecutor) webDriver; js.executeScript("window.scrollTo(0, 0);"); }