Table of Contents

Class SafariOptions

Namespace
OpenQA.Selenium.Safari
Assembly
WebDriver.dll

Class to manage options specific to SafariDriver

public class SafariOptions
Inheritance
SafariOptions
Inherited Members

Examples

SafariOptions options = new SafariOptions();
options.SkipExtensionInstallation = true;

For use with SafariDriver:

SafariDriver driver = new SafariDriver(options);

For use with RemoteWebDriver:

RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), options.ToCapabilities());

Constructors

SafariOptions()

Initializes a new instance of the SafariOptions class.

public SafariOptions()

Properties

CustomExtensionPath

Gets or sets the path to the SafariDriver.safariextz file from which the extension will be installed.

[Obsolete("No longer used, as the extension now must be manually installed by the user. Will be removed in a future version.")]
public string CustomExtensionPath { get; set; }

Property Value

string

Port

Gets or sets the port on which the SafariDriver will listen for commands.

public int Port { get; set; }

Property Value

int

SafariLocation

Gets or sets the install location of the Safari browser.

public string SafariLocation { get; set; }

Property Value

string

SkipExtensionInstallation

Gets or sets a value indicating whether to skip the installation of the SafariDriver extension.

[Obsolete("No longer used, as the extension now must be manually installed by the user. Will be removed in a future version.")]
public bool SkipExtensionInstallation { get; set; }

Property Value

bool

Remarks

Set this property to true if the SafariDriver extension is already installed in Safari, and you don't want to overwrite it with the version included with WebDriver.

Methods

AddAdditionalCapability(string, object)

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

public 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.

ToCapabilities()

Returns ICapabilities for Safari with these options included as capabilities. This copies the options. Further changes will not be reflected in the returned capabilities.

public ICapabilities ToCapabilities()

Returns

ICapabilities

The ICapabilities for Safari with these options.