ChromeOptions ClassWebDriver
Class to manage options specific to ChromeDriver
Inheritance Hierarchy

SystemObject
  OpenQA.SeleniumDriverOptions
    OpenQA.Selenium.ChromeChromeOptions

Namespace: OpenQA.Selenium.Chrome
Assembly: WebDriver (in WebDriver.dll) Version: 3.1.0
Syntax

public class ChromeOptions : DriverOptions

The ChromeOptions type exposes the following members.

Constructors

  NameDescription
Public methodChromeOptions
Initializes a new instance of the ChromeOptions class
Top
Properties

  NameDescription
Public propertyArguments
Gets the list of arguments appended to the Chrome command line as a string array.
Public propertyBinaryLocation
Gets or sets the location of the Chrome browser's binary executable file.
Public propertyDebuggerAddress
Gets or sets the address of a Chrome debugger server to connect to. Should be of the form "{hostname|IP address}:port".
Public propertyExtensions
Gets the list of extensions to be installed as an array of base64-encoded strings.
Public propertyLeaveBrowserRunning
Gets or sets a value indicating whether Chrome should be left running after the ChromeDriver instance is exited. Defaults to .
Public propertyMinidumpPath
Gets or sets the directory in which to store minidump files.
Public propertyPerformanceLoggingPreferences
Gets or sets the performance logging preferences for the driver.
Public propertyProxy
Gets or sets the proxy to use with this instance of Chrome.
Top
Methods

  NameDescription
Public methodAddAdditionalCapability(String, Object)
Provides a means to add additional capabilities not yet added as type safe options for the Chrome driver.
(Overrides DriverOptionsAddAdditionalCapability(String, Object).)
Public methodAddAdditionalCapability(String, Object, Boolean)
Provides a means to add additional capabilities not yet added as type safe options for the Chrome driver.
Public methodAddArgument
Adds a single argument to the list of arguments to be appended to the Chrome.exe command line.
Public methodAddArguments(IEnumerableString)
Adds arguments to be appended to the Chrome.exe command line.
Public methodAddArguments(String)
Adds arguments to be appended to the Chrome.exe command line.
Public methodAddEncodedExtension
Adds a base64-encoded string representing a Chrome extension to the list of extensions to be installed in the instance of Chrome.
Public methodAddEncodedExtensions(IEnumerableString)
Adds a list of base64-encoded strings representing Chrome extensions to be installed in the instance of Chrome.
Public methodAddEncodedExtensions(String)
Adds a list of base64-encoded strings representing Chrome extensions to the list of extensions to be installed in the instance of Chrome.
Public methodAddExcludedArgument
Adds a single argument to be excluded from the list of arguments passed by default to the Chrome.exe command line by chromedriver.exe.
Public methodAddExcludedArguments(IEnumerableString)
Adds arguments to be excluded from the list of arguments passed by default to the Chrome.exe command line by chromedriver.exe.
Public methodAddExcludedArguments(String)
Adds arguments to be excluded from the list of arguments passed by default to the Chrome.exe command line by chromedriver.exe.
Public methodAddExtension
Adds a path to a packed Chrome extension (.crx file) to the list of extensions to be installed in the instance of Chrome.
Public methodAddExtensions(IEnumerableString)
Adds a list of paths to packed Chrome extensions (.crx files) to be installed in the instance of Chrome.
Public methodAddExtensions(String)
Adds a list of paths to packed Chrome extensions (.crx files) to be installed in the instance of Chrome.
Public methodAddLocalStatePreference
Adds a preference for the local state file in the user's data directory for Chrome. If the specified preference already exists, it will be overwritten.
Public methodAddUserProfilePreference
Adds a preference for the user-specific profile or "user data directory." If the specified preference already exists, it will be overwritten.
Public methodAddWindowType
Adds a type of window that will be listed in the list of window handles returned by the Chrome driver.
Public methodAddWindowTypes(IEnumerableString)
Adds a list of window types that will be listed in the list of window handles returned by the Chrome driver.
Public methodAddWindowTypes(String)
Adds a list of window types that will be listed in the list of window handles returned by the Chrome driver.
Public methodEnableMobileEmulation(String)
Allows the Chrome browser to emulate a mobile device.
Public methodEnableMobileEmulation(ChromeMobileEmulationDeviceSettings)
Allows the Chrome browser to emulate a mobile device.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodGenerateLoggingPreferencesDictionary
Generates the logging preferences dictionary for transmission as a desired capability.
(Inherited from DriverOptions.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetLoggingPreference
Sets the logging preferences for this driver.
(Inherited from DriverOptions.)
Public methodToCapabilities
Returns DesiredCapabilities for Chrome with these options included as capabilities. This does not copy the options. Further changes will be reflected in the returned capabilities.
(Overrides DriverOptionsToCapabilities.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Fields

  NameDescription
Public fieldStatic memberCapability
Gets the name of the capability used to store Chrome options in a DesiredCapabilities object.
Top
Remarks

Used with ChromeDriver.exe v17.0.963.0 and higher.
Examples

ChromeOptions options = new ChromeOptions();
options.AddExtensions("\path\to\extension.crx");
options.BinaryLocation = "\path\to\chrome";

For use with ChromeDriver:

ChromeDriver driver = new ChromeDriver(options);

For use with RemoteWebDriver:

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

Reference