Skip to content

Commit 97dfc85

Browse files
committed
Do some refactoring
1 parent 41d8fb2 commit 97dfc85

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14651,8 +14651,14 @@ def setUp(self, masterqa_mode=False):
1465114651
d_height=self.__device_height,
1465214652
d_p_r=self.__device_pixel_ratio,
1465314653
)
14654-
if self.driver.timeouts.implicit_wait > 0:
14655-
self.driver.implicitly_wait(0)
14654+
try:
14655+
if self.driver.timeouts.implicit_wait > 0:
14656+
self.driver.implicitly_wait(0)
14657+
except Exception:
14658+
try:
14659+
self.driver.implicitly_wait(0)
14660+
except Exception:
14661+
pass
1465614662
self._default_driver = self.driver
1465714663
if self._reuse_session:
1465814664
sb_config.shared_driver = self.driver
@@ -14671,10 +14677,13 @@ def setUp(self, masterqa_mode=False):
1467114677
self.set_time_limit(self.time_limit)
1467214678

1467314679
# Configure the page load timeout
14674-
if hasattr(settings, "PAGE_LOAD_TIMEOUT"):
14675-
self.driver.set_page_load_timeout(settings.PAGE_LOAD_TIMEOUT)
14676-
else:
14677-
self.driver.set_page_load_timeout(120) # Selenium uses 300
14680+
try:
14681+
if hasattr(settings, "PAGE_LOAD_TIMEOUT"):
14682+
self.driver.set_page_load_timeout(settings.PAGE_LOAD_TIMEOUT)
14683+
else:
14684+
self.driver.set_page_load_timeout(120) # Selenium uses 300
14685+
except Exception:
14686+
pass
1467814687

1467914688
# Set the start time for the test (in ms).
1468014689
# Although the pytest clock starts before setUp() begins,

0 commit comments

Comments
 (0)