Table of Contents

Class DriverOptions

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Base class for managing options specific to a browser driver.

public abstract class DriverOptions
Inheritance
DriverOptions
Derived
Inherited Members

Constructors

DriverOptions()

protected DriverOptions()

Properties

AcceptInsecureCertificates

Gets or sets a value indicating whether the browser should accept self-signed SSL certificates.

public bool? AcceptInsecureCertificates { get; set; }

Property Value

bool?

BrowserName

Gets or sets the name of the browser.

public string BrowserName { get; protected set; }

Property Value

string

BrowserVersion

Gets or sets the version of the browser.

public string BrowserVersion { get; set; }

Property Value

string

PageLoadStrategy

Gets or sets the value for describing how the browser is to wait for pages to load in the browser. Defaults to Default.

public PageLoadStrategy PageLoadStrategy { get; set; }

Property Value

PageLoadStrategy

PlatformName

Gets or sets the name of the platform on which the browser is running.

public string PlatformName { get; set; }

Property Value

string

Proxy

Gets or sets the Proxy to be used with this browser.

public Proxy Proxy { get; set; }

Property Value

Proxy

UnhandledPromptBehavior

Gets or sets the value for describing how unexpected alerts are to be handled in the browser. Defaults to Default.

public UnhandledPromptBehavior UnhandledPromptBehavior { get; set; }

Property Value

UnhandledPromptBehavior

Methods

AddAdditionalCapability(string, object)

Provides a means to add additional capabilities not yet added as type safe options for the specific browser driver.

public abstract void AddAdditionalCapability(string capabilityName, object capabilityValue)

Parameters

capabilityName string

The name of the capability to add.

capabilityValue object

The value of the capability to add.

Remarks

Calling AddAdditionalCapability(string, object) where capabilityName has already been added will overwrite the existing value with the new value in capabilityValue.

Exceptions

ArgumentException

thrown when attempting to add a capability for which there is already a type safe option, or when capabilityName is null or the empty string.

AddKnownCapabilityName(string, string)

Adds a known capability to the list of known capabilities and associates it with the type-safe property name of the options class to be used instead.

protected void AddKnownCapabilityName(string capabilityName, string typeSafeOptionName)

Parameters

capabilityName string

The name of the capability.

typeSafeOptionName string

The name of the option property or method to be used instead.

GenerateDesiredCapabilities(bool)

protected DesiredCapabilities GenerateDesiredCapabilities(bool isSpecificationCompliant)

Parameters

isSpecificationCompliant bool

Returns

DesiredCapabilities

GenerateLoggingPreferencesDictionary()

Generates the logging preferences dictionary for transmission as a desired capability.

protected Dictionary<string, object> GenerateLoggingPreferencesDictionary()

Returns

Dictionary<string, object>

The dictionary containing the logging preferences.

GetTypeSafeOptionName(string)

protected string GetTypeSafeOptionName(string capabilityName)

Parameters

capabilityName string

Returns

string

IsKnownCapabilityName(string)

protected bool IsKnownCapabilityName(string capabilityName)

Parameters

capabilityName string

Returns

bool

SetLoggingPreference(string, LogLevel)

Sets the logging preferences for this driver.

public void SetLoggingPreference(string logType, LogLevel logLevel)

Parameters

logType string

The type of log for which to set the preference. Known log types can be found in the LogType class.

logLevel LogLevel

The LogLevel value to which to set the log level.

ToCapabilities()

Returns DesiredCapabilities for the specific browser driver with these options included ascapabilities. This does not copy the options. Further changes will be reflected in the returned capabilities.

public abstract ICapabilities ToCapabilities()

Returns

ICapabilities

The DesiredCapabilities for browser driver with these options.