Exception handling in Selenium Java