Commit 01830c30 by Will Daly

Merge pull request #1202 from edx/will/chrome-not-reachable

Catch WebDriver exceptions when creating selenium browser
parents 7ce2878a 05669fad
......@@ -99,16 +99,18 @@ def initial_setup(server):
success = False
num_attempts = 0
while (not success) and num_attempts < MAX_VALID_BROWSER_ATTEMPTS:
world.browser = Browser(browser_driver)
# Try to visit the main page
# If the browser session is invalid, this will
# Load the browser and try to visit the main page
# If the browser couldn't be reached or
# the browser session is invalid, this will
# raise a WebDriverException
try:
world.browser = Browser(browser_driver)
world.visit('/')
except WebDriverException:
world.browser.quit()
if hasattr(world, 'browser'):
world.browser.quit()
num_attempts += 1
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment