MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / alert

Method alert

py/selenium/webdriver/remote/switch_to.py:48–58  ·  view source on GitHub ↗

Switches focus to an alert on the page. Example: alert = driver.switch_to.alert

(self)

Source from the content-addressed store, hash-verified

46
47 @property
48 def alert(self) -> Alert:
49 """Switches focus to an alert on the page.
50
51 Example:
52 alert = driver.switch_to.alert
53 """
54 from selenium.webdriver.common.alert import Alert
55
56 alert = Alert(self._driver)
57 _ = alert.text
58 return alert
59
60 def default_content(self) -> None:
61 """Switch focus to the default frame.

Callers

nothing calls this directly

Calls 1

AlertClass · 0.90

Tested by

no test coverage detected