selenium.webdriver.common.bidi.emulationΒΆ
Classes
|
BiDi implementation of the emulation module. |
|
Represents geolocation coordinates. |
|
Represents a geolocation position error. |
- class selenium.webdriver.common.bidi.emulation.GeolocationCoordinates(latitude: float, longitude: float, accuracy: float = 1.0, altitude: float | None = None, altitude_accuracy: float | None = None, heading: float | None = None, speed: float | None = None)[source]ΒΆ
Represents geolocation coordinates.
Initialize GeolocationCoordinates.
Parameters:ΒΆ
latitude: Latitude coordinate (-90.0 to 90.0). longitude: Longitude coordinate (-180.0 to 180.0). accuracy: Accuracy in meters (>= 0.0), defaults to 1.0. altitude: Altitude in meters or None, defaults to None. altitude_accuracy: Altitude accuracy in meters (>= 0.0) or None, defaults to None. heading: Heading in degrees (0.0 to 360.0) or None, defaults to None. speed: Speed in meters per second (>= 0.0) or None, defaults to None.
Raises:ΒΆ
ValueError: If coordinates are out of valid range or if altitude_accuracy is provided without altitude.
- property latitudeΒΆ
- property longitudeΒΆ
- property accuracyΒΆ
- property altitudeΒΆ
- property altitude_accuracyΒΆ
- property headingΒΆ
- property speedΒΆ
- class selenium.webdriver.common.bidi.emulation.GeolocationPositionError(type: str = 'positionUnavailable')[source]ΒΆ
Represents a geolocation position error.
- TYPE_POSITION_UNAVAILABLE = 'positionUnavailable'ΒΆ
- class selenium.webdriver.common.bidi.emulation.Emulation(conn)[source]ΒΆ
BiDi implementation of the emulation module.
- set_geolocation_override(coordinates: GeolocationCoordinates | None = None, error: GeolocationPositionError | None = None, contexts: list[str] | None = None, user_contexts: list[str] | None = None) None [source]ΒΆ
Set geolocation override for the given contexts or user contexts.
Parameters:ΒΆ
coordinates: Geolocation coordinates to emulate, or None. error: Geolocation error to emulate, or None. contexts: List of browsing context IDs to apply the override to. user_contexts: List of user context IDs to apply the override to.
Raises:ΒΆ
- ValueError: If both coordinates and error are provided, or if both contexts
and user_contexts are provided, or if neither contexts nor user_contexts are provided.