Skip to content

Commit c4781d7

Browse files
committed
Fix issue with auto-closing alert pop-ups
1 parent 87a7f92 commit c4781d7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,6 +2411,13 @@ def assert_element_not_visible(self, selector, by=By.CSS_SELECTOR,
24112411
############
24122412

24132413
def wait_for_ready_state_complete(self, timeout=settings.EXTREME_TIMEOUT):
2414+
try:
2415+
# If there's an alert, skip
2416+
self.driver.switch_to.alert
2417+
return
2418+
except Exception:
2419+
# If there's no alert, continue
2420+
pass
24142421
if self.timeout_multiplier and timeout == settings.EXTREME_TIMEOUT:
24152422
timeout = self.__get_new_timeout(timeout)
24162423
is_ready = js_utils.wait_for_ready_state_complete(self.driver, timeout)

0 commit comments

Comments
 (0)