Table of Contents

Class RemoteSessionSettings

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Base class for managing options specific to a browser driver.

public class RemoteSessionSettings : ICapabilities
Inheritance
RemoteSessionSettings
Implements
Inherited Members

Constructors

RemoteSessionSettings()

Creates a new instance of the RemoteSessionSettings class.

public RemoteSessionSettings()

RemoteSessionSettings(DriverOptions, params DriverOptions[])

Creates a new instance of the RemoteSessionSettings class, containing the specified DriverOptions to use in the remote session.

public RemoteSessionSettings(DriverOptions mustMatchDriverOptions, params DriverOptions[] firstMatchDriverOptions)

Parameters

mustMatchDriverOptions DriverOptions

A DriverOptions object that contains values that must be matched by the remote end to create the remote session.

firstMatchDriverOptions DriverOptions[]

A list of DriverOptions objects that contain values that may be matched by the remote end to create the remote session.

Properties

this[string]

Gets the capability value with the specified name.

public object this[string capabilityName] { get; }

Parameters

capabilityName string

The name of the capability to get.

Property Value

object

The value of the capability.

Exceptions

ArgumentException

The specified capability name is not in the set of capabilities.

ArgumentNullException

If capabilityName is null.

Methods

AddFirstMatchDriverOption(DriverOptions)

Adds a DriverOptions object to the list of options containing values to be "first matched" by the remote end.

public void AddFirstMatchDriverOption(DriverOptions options)

Parameters

options DriverOptions

The DriverOptions to add to the list of "first matched" options.

AddMetadataSetting(string, object)

Add a metadata setting to this set of remote session settings.

public void AddMetadataSetting(string settingName, object settingValue)

Parameters

settingName string

The name of the setting to set.

settingValue object

The value of the setting.

Exceptions

ArgumentException

If the setting name is null or empty.

-or-

If one of the reserved names of metadata settings.

GetCapability(string)

Gets a capability of the browser.

public object GetCapability(string capability)

Parameters

capability string

The capability to get.

Returns

object

An object associated with the capability, or null if the capability is not set in this set of capabilities.

HasCapability(string)

Gets a value indicating whether the browser has a given capability.

public bool HasCapability(string capability)

Parameters

capability string

The capability to get.

Returns

bool

Returns true if this set of capabilities has the capability; otherwise, false.

SetMustMatchDriverOptions(DriverOptions)

Adds a DriverOptions object containing values that must be matched by the remote end to successfully create a session.

public void SetMustMatchDriverOptions(DriverOptions options)

Parameters

options DriverOptions

The DriverOptions that must be matched by the remote end to successfully create a session.

ToDictionary()

Return a dictionary representation of this RemoteSessionSettings.

public Dictionary<string, object> ToDictionary()

Returns

Dictionary<string, object>

A Dictionary<TKey, TValue> representation of this RemoteSessionSettings.