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

Method emulation

py/selenium/webdriver/remote/webdriver.py:1371–1392  ·  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

1369
1370 @property
1371 def emulation(self) -> Emulation:
1372 """Get an emulation module object for BiDi emulation commands.
1373
1374 Returns:
1375 An object containing access to BiDi emulation commands.
1376
1377 Examples:
1378 ```
1379 from selenium.webdriver.common.bidi.emulation import GeolocationCoordinates
1380
1381 coordinates = GeolocationCoordinates(37.7749, -122.4194)
1382 driver.emulation.set_geolocation_override(coordinates=coordinates, contexts=[context_id])
1383 ```
1384 """
1385 if not self._websocket_connection:
1386 self._start_bidi()
1387
1388 assert self._websocket_connection is not None
1389 if self._emulation is None:
1390 self._emulation = Emulation(self._websocket_connection)
1391
1392 return self._emulation
1393
1394 @property
1395 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