refactored testing with selenium webdriver