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

Method active_element

py/selenium/webdriver/remote/switch_to.py:39–45  ·  view source on GitHub ↗

Returns the element with focus, or BODY if nothing has focus. Example: element = driver.switch_to.active_element

(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected