Class DriverOptions
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
BrowserVersion
Gets or sets the version of the browser.
public string BrowserVersion { get; set; }
Property Value
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
PlatformName
Gets or sets the name of the platform on which the browser is running.
public string PlatformName { get; set; }
Property Value
Proxy
Gets or sets the Proxy to be used with this browser.
public Proxy Proxy { get; set; }
Property Value
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
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
stringThe name of the capability to add.
capabilityValue
objectThe 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
stringThe name of the capability.
typeSafeOptionName
stringThe name of the option property or method to be used instead.
GenerateDesiredCapabilities(bool)
protected DesiredCapabilities GenerateDesiredCapabilities(bool isSpecificationCompliant)
Parameters
isSpecificationCompliant
bool
Returns
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
IsKnownCapabilityName(string)
protected bool IsKnownCapabilityName(string capabilityName)
Parameters
capabilityName
string
Returns
SetLoggingPreference(string, LogLevel)
Sets the logging preferences for this driver.
public void SetLoggingPreference(string logType, LogLevel logLevel)
Parameters
logType
stringThe type of log for which to set the preference. Known log types can be found in the LogType class.
logLevel
LogLevelThe 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.