Skip to content

Commit 8748125

Browse files
committed
Better error-handling for the "open()" method
1 parent ba2b13a commit 8748125

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,14 @@ def open(self, url):
157157
if ("http:") in c_url or ("https:") in c_url or ("file:") in c_url:
158158
if self.get_domain_url(url) != self.get_domain_url(c_url):
159159
self.open_new_window(switch_to=True)
160-
self.driver.get(url)
160+
try:
161+
self.driver.get(url)
162+
except Exception as e:
163+
if "ERR_CONNECTION_TIMED_OUT" in e.msg:
164+
self.sleep(0.5)
165+
self.driver.get(url)
166+
else:
167+
raise Exception(e.msg)
161168
if settings.WAIT_FOR_RSC_ON_PAGE_LOADS:
162169
self.wait_for_ready_state_complete()
163170
self.__demo_mode_pause_if_active()

0 commit comments

Comments
 (0)