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

Method emulation

py/selenium/webdriver/remote/webdriver.py:1626–1647  ·  view source on GitHub ↗

Get an emulation module object for BiDi emulation commands. Returns: An object containing access to BiDi emulation commands. Examples: ``` from selenium.webdriver.common.bidi.emulation import GeolocationCoordinates coordinates = Geol

(self)

Source from the content-addressed store, hash-verified

1624
1625 @property
1626 def emulation(self) -> Emulation:
1627 """Get an emulation module object for BiDi emulation commands.
1628
1629 Returns:
1630 An object containing access to BiDi emulation commands.
1631
1632 Examples:
1633 ```
1634 from selenium.webdriver.common.bidi.emulation import GeolocationCoordinates
1635
1636 coordinates = GeolocationCoordinates(37.7749, -122.4194)
1637 driver.emulation.set_geolocation_override(coordinates=coordinates, contexts=[context_id])
1638 ```
1639 """
1640 if not self._websocket_connection:
1641 self._start_bidi()
1642
1643 assert self._websocket_connection is not None
1644 if self._emulation is None:
1645 self._emulation = Emulation(self._websocket_connection)
1646
1647 return self._emulation
1648
1649 @property
1650 def input(self) -> Input:

Callers 2

ChromeClass · 0.80
EdgeClass · 0.80

Calls 2

_start_bidiMethod · 0.95
EmulationClass · 0.90

Tested by

no test coverage detected