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

Method switch_to

py/selenium/webdriver/remote/webdriver.py:802–818  ·  view source on GitHub ↗

Return an object containing all options to switch focus into. Returns: An object containing all options to switch focus into. Examples: `element = driver.switch_to.active_element` `alert = driver.switch_to.alert` `driver.switch_to.def

(self)

Source from the content-addressed store, hash-verified

800
801 @property
802 def switch_to(self) -> SwitchTo:
803 """Return an object containing all options to switch focus into.
804
805 Returns:
806 An object containing all options to switch focus into.
807
808 Examples:
809 `element = driver.switch_to.active_element`
810 `alert = driver.switch_to.alert`
811 `driver.switch_to.default_content()`
812 `driver.switch_to.frame("frame_name")`
813 `driver.switch_to.frame(1)`
814 `driver.switch_to.frame(driver.find_elements(By.TAG_NAME, "iframe")[0])`
815 `driver.switch_to.parent_frame()`
816 `driver.switch_to.window("main")`
817 """
818 return self._switch_to
819
820 # Navigation
821 def back(self) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected