Class SetTimeZoneOverrideCommandParameters
- Namespace
- WebDriverBiDi.Emulation
- Assembly
- WebDriverBiDi.dll
Provides parameters for the emulation.setTimezoneOverride command.
public class SetTimeZoneOverrideCommandParameters : CommandParameters<SetTimeZoneOverrideCommandResult>
- Inheritance
-
SetTimeZoneOverrideCommandParameters
- Inherited Members
Remarks
Unlike most emulation commands, this one has no global form: the specification requires the command to
name a scope, so a call that leaves both Contexts and UserContexts empty is
rejected with InvalidArgument. Add at least one browsing context or user context
before executing the command. emulation.setNetworkConditions, by contrast, does accept an
unscoped call, and applies the network conditions it was given as the session-wide default,
applied to every context that has no per-context or per-user-context override; this command has no
such default.
Constructors
SetTimeZoneOverrideCommandParameters()
Initializes a new instance of the SetTimeZoneOverrideCommandParameters class.
public SetTimeZoneOverrideCommandParameters()
Properties
Contexts
Gets the browsing contexts for which to set the time zone override.
[JsonIgnore]
public List<string> Contexts { get; }
Property Value
Remarks
The protocol requires this property, when present, to contain at least one entry. An empty list therefore means "not specified": the property is omitted from the JSON payload entirely, and an empty array is never sent. Add entries to the list to scope the command.
The two scopes are mutually exclusive: a command that names both browsing contexts and user contexts is
rejected by the remote end with an invalid argument error. Scope the command one way or the other.
MethodName
Gets the method name of the command.
[JsonIgnore]
public override string MethodName { get; }
Property Value
ResetTimeZoneOverride
Gets a pre-initialized instance of SetTimeZoneOverrideCommandParameters with the TimeZone property set to null to clear any existing time zone override. Returns a new instance on each access to allow for modification of the properties without affecting other uses. Functionally equivalent to using the parameterless constructor, but provided as a named property to make the intent of clearing the override more explicit in code that uses this property.
public static SetTimeZoneOverrideCommandParameters ResetTimeZoneOverride { get; }
Property Value
TimeZone
Gets or sets the emulated time zone for the browser. The value should be a valid structurally correct named time zone identifier (e.g., "America/New_York", "Europe/London", "Asia/Tokyo", "Asia/Kolkata" etc.), or a UTC offset time zone identifier with a two-digit hour (e.g., "-05:00", "+05:30", etc.; a conforming remote end rejects single-digit hours such as "-5:00"). When null, clears the override.
[JsonPropertyName("timezone")]
public string? TimeZone { get; set; }
Property Value
UserContexts
Gets the user contexts for which to set the time zone override.
[JsonIgnore]
public List<string> UserContexts { get; }
Property Value
Remarks
The protocol requires this property, when present, to contain at least one entry. An empty list therefore means "not specified": the property is omitted from the JSON payload entirely, and an empty array is never sent. Add entries to the list to scope the command.
The two scopes are mutually exclusive: a command that names both browsing contexts and user contexts is
rejected by the remote end with an invalid argument error. Scope the command one way or the other.