From e9bb6608585a1c5160d45704160a1f215c88de26 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 2 May 2016 19:55:55 -0400 Subject: [PATCH] Fix switching to an alert. --- seleniumbase/fixtures/page_actions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seleniumbase/fixtures/page_actions.py b/seleniumbase/fixtures/page_actions.py index 50f18f2b..29e1d94a 100755 --- a/seleniumbase/fixtures/page_actions.py +++ b/seleniumbase/fixtures/page_actions.py @@ -340,7 +340,7 @@ def wait_for_and_dismiss_alert(driver, timeout=settings.LARGE_TIMEOUT): def wait_for_and_switch_to_alert(driver, timeout=settings.LARGE_TIMEOUT): """ Wait for a browser alert to appear, and switch to it. This should be usable - as a drop-in replacement for driver.switch_to.alert() when the alert box + as a drop-in replacement for driver.switch_to.alert when the alert box may not exist yet. @Params driver - the webdriver object (required) @@ -349,7 +349,7 @@ def wait_for_and_switch_to_alert(driver, timeout=settings.LARGE_TIMEOUT): for x in range(int(timeout * 10)): try: - alert = driver.switch_to.alert() + alert = driver.switch_to.alert # Raises exception if no alert present dummy_variable = alert.text # noqa return alert