Improving error handling in WebDriverUtilities.py