Switches focus to an alert on the page. Example: alert = driver.switch_to.alert
(self)
| 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. |