Skip to content
Snippets Groups Projects
Commit 70e04858 authored by Marco Malavolti's avatar Marco Malavolti
Browse files

Wait 3 sec and retry to get webdriver after any exception

parent 9da2c148
Branches
No related tags found
No related merge requests found
...@@ -179,13 +179,13 @@ def get_driver_selenium(idp=None,sp=None,debugSelenium=False): ...@@ -179,13 +179,13 @@ def get_driver_selenium(idp=None,sp=None,debugSelenium=False):
sha1_idp = sha1(idp['entityID']) sha1_idp = sha1(idp['entityID'])
try: try:
driver = webdriver.Chrome(e2p.PATHCHROMEDRIVER, options=chrome_options, service_args=['--verbose', f'--log-path={e2p.ECCS2SELENIUMLOGDIR}/{sha1_idp}_{label_idp}_{label_sp}.log']) driver = webdriver.Chrome(e2p.PATHCHROMEDRIVER, options=chrome_options, service_args=['--verbose', f'--log-path={e2p.ECCS2SELENIUMLOGDIR}/{sha1_idp}_{label_idp}_{label_sp}.log'])
except WebDriverException: except: # Wait 3 seconds before try again to get the webdriver for all kind of exception will occur
time.sleep(3) time.sleep(3)
driver = webdriver.Chrome(e2p.PATHCHROMEDRIVER, options=chrome_options, service_args=['--verbose', f'--log-path={e2p.ECCS2SELENIUMLOGDIR}/{sha1_idp}_{label_idp}_{label_sp}.log']) driver = webdriver.Chrome(e2p.PATHCHROMEDRIVER, options=chrome_options, service_args=['--verbose', f'--log-path={e2p.ECCS2SELENIUMLOGDIR}/{sha1_idp}_{label_idp}_{label_sp}.log'])
else: else:
try: try:
driver = webdriver.Chrome(e2p.PATHCHROMEDRIVER, options=chrome_options) driver = webdriver.Chrome(e2p.PATHCHROMEDRIVER, options=chrome_options)
except WebDriverException: except: # Wait 3 seconds before try again to get the webdriver for all kind of exception will occur
time.sleep(3) time.sleep(3)
driver = webdriver.Chrome(e2p.PATHCHROMEDRIVER, options=chrome_options) driver = webdriver.Chrome(e2p.PATHCHROMEDRIVER, options=chrome_options)
return driver return driver
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment