Class SubscribeCommandParameters
- Namespace
- WebDriverBiDi.Session
- Assembly
- WebDriverBiDi.dll
Provides parameters for the session.subscribe command.
public class SubscribeCommandParameters : CommandParameters<SubscribeCommandResult>
- Inheritance
-
SubscribeCommandParameters
- Inherited Members
Constructors
SubscribeCommandParameters(IList<string>, IList<string>?, IList<string>?)
Initializes a new instance of the SubscribeCommandParameters class.
public SubscribeCommandParameters(IList<string> events, IList<string>? contexts = null, IList<string>? userContexts = null)
Parameters
eventsIList<string>The list of events to which to subscribe.
contextsIList<string>The list of browsing context IDs for which to subscribe to the specified events.
userContextsIList<string>The list of user context IDs for which to subscribe to the specified events.
Remarks
The specification requires a subscription to name at least one event. Unlike values whose specification constraints the remote end enforces, an empty events list is rejected here: a subscription to no events cannot be meaningful under any revision of the specification, and accepting it would only defer a certain failure to the remote end.
Exceptions
- ArgumentException
Thrown when no events are specified in the events list.
SubscribeCommandParameters(string, IList<string>?, IList<string>?)
Initializes a new instance of the SubscribeCommandParameters class for a single event.
public SubscribeCommandParameters(string eventName, IList<string>? contexts = null, IList<string>? userContexts = null)
Parameters
eventNamestringThe event to which to subscribe.
contextsIList<string>The list of browsing context IDs for which to subscribe to the specified event.
userContextsIList<string>The list of user context IDs for which to subscribe to the specified event.
Properties
Contexts
Gets the list of browsing context IDs for which to subscribe to the specified events.
[JsonIgnore]
public List<string> Contexts { get; }
Property Value
Events
Gets the list of events to which to subscribe.
[JsonPropertyName("events")]
public List<string> Events { get; }
Property Value
MethodName
Gets the method name of the command.
[JsonIgnore]
public override string MethodName { get; }
Property Value
UserContexts
Gets the list of user context IDs for which to subscribe to the specified events.
[JsonIgnore]
public List<string> UserContexts { get; }