How to handle browser navigations (Forward/Backward Buttons, close the browser) in Selenium?