diff --git a/py/selenium/webdriver/support/expected_conditions.py b/py/selenium/webdriver/support/expected_conditions.py index 4987631292d39..94931d1c062f4 100644 --- a/py/selenium/webdriver/support/expected_conditions.py +++ b/py/selenium/webdriver/support/expected_conditions.py @@ -692,19 +692,16 @@ def _predicate(driver: WebDriver): return _predicate -def alert_is_present() -> Callable[[WebDriver], Alert | bool]: +def alert_is_present() -> Callable[[WebDriver], Alert | Literal[False]]: """Check that an alert is present and switch to it. Returns: - The Alert once it is located. + The Alert once it is located, or False if no alert is present. Example: from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC alert = WebDriverWait(driver, 10).until(EC.alert_is_present()) - - Note: - If the alert is present it switches the given driver to it. """ def _predicate(driver: WebDriver):