# Class webdriver.Capabilities

code »

## Constructor

webdriver.Capabilities ( opt_other )

Parameters

opt_other: `(webdriver.Capabilities|Object)=`
  Another set of capabilities to merge into this instance.

Show:Public Protected Private

## Instance Methods

code »get ( key ) ⇒ `*`

Parameters

key: `string`
  The capability to return.

Returns

The capability with the given key, or `null` if it has not been set.

code »has ( key ) ⇒ `boolean`

Parameters

key: `string`
  The capability to check.

Returns

Whether the specified capability is set.

code »merge ( other ) ⇒ `!webdriver.Capabilities`

Merges another set of capabilities into this instance. Any duplicates in the provided set will override those already set on this instance.

Parameters

other: `!(webdriver.Capabilities|Object)`
  The capabilities to merge into this instance.

Returns

A self reference.

code »set ( key, value ) ⇒ `!webdriver.Capabilities`

Parameters

key: `string`
  The capability to set.
value: `*`
  The capability value. Capability values must be JSON serializable. Pass `null` to unset the capability.

Returns

A self reference.

code »setAlertBehavior ( behavior ) ⇒ `!webdriver.Capabilities`

Sets the default action to take with an unexpected alert before returning an error.

Parameters

behavior: `string`
  The desired behavior; should be "accept", "dismiss", or "ignore". Defaults to "dismiss".

Returns

A self reference.

code »setEnableNativeEvents ( enabled ) ⇒ `!webdriver.Capabilities`

Sets whether native events should be used.

Parameters

enabled: `boolean`
  Whether to enable native events.

Returns

A self reference.

code »setLoggingPrefs ( prefs ) ⇒ `!webdriver.Capabilities`

Sets the logging preferences. Preferences may be specified as a `webdriver.logging.Preferences` instance, or a as a map of log-type to log-level.

Parameters

prefs: `!(webdriver.logging.Preferences|Object.<string, string>)`
  The logging preferences.

Returns

A self reference.

code »setProxy ( proxy ) ⇒ `!webdriver.Capabilities`

Sets the proxy configuration for this instance.

Parameters

proxy: `webdriver.ProxyConfig`
  The desired proxy configuration.

Returns

A self reference.

code »setScrollBehavior ( behavior ) ⇒ `!webdriver.Capabilities`

Sets how elements should be scrolled into view for interaction.

Parameters

behavior: `number`
  The desired scroll behavior: either 0 to align with the top of the viewport or 1 to align with the bottom.

Returns

A self reference.

code »toJSON ( ) ⇒ `!Object`

Returns

The JSON representation of this instance.

## Instance Properties

code »caps_ : `!Object`

## Static Functions

code »webdriver.Capabilities.android ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for Android.

code »webdriver.Capabilities.chrome ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for Chrome.

code »webdriver.Capabilities.firefox ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for Firefox.

code »webdriver.Capabilities.htmlunit ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for HTMLUnit.

code »webdriver.Capabilities.htmlunitwithjs ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for HTMLUnit with enabled Javascript.

code »webdriver.Capabilities.ie ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for Internet Explorer.

code »webdriver.Capabilities.ipad ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for iPad.

code »webdriver.Capabilities.iphone ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for iPhone.

code »webdriver.Capabilities.opera ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for Opera.

code »webdriver.Capabilities.phantomjs ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for PhantomJS.

code »webdriver.Capabilities.safari ( ) ⇒ `!webdriver.Capabilities`

Returns

A basic set of capabilities for Safari.