Returns the element with focus, or BODY if nothing has focus. Example: element = driver.switch_to.active_element
(self)
| 37 | |
| 38 | @property |
| 39 | def active_element(self) -> WebElement: |
| 40 | """Returns the element with focus, or BODY if nothing has focus. |
| 41 | |
| 42 | Example: |
| 43 | element = driver.switch_to.active_element |
| 44 | """ |
| 45 | return self._driver.execute(Command.W3C_GET_ACTIVE_ELEMENT)["value"] |
| 46 | |
| 47 | @property |
| 48 | def alert(self) -> Alert: |