# Class Capabilities

Describes a set of capabilities for a WebDriver session.

#### Hierarchy

- Capabilities

#####
Index

### Constructors

constructor

### Methods

[serialize]
delete
get
getAcceptInsecureCerts
getAlertBehavior
getBrowserName
getBrowserVersion
getPageLoadStrategy
getPlatform
getProxy
has
keys
merge
set
setAcceptInsecureCerts
setAlertBehavior
setBrowserName
setBrowserVersion
setLoggingPrefs
setPageLoadStrategy
setPlatform
setProxy
chrome
edge
firefox
ie
safari

## Constructors

### constructor

- new Capabilities(other?): Capabilities

- #### Parameters

  - ##### `Optional` other: {} | Capabilities | Map<string, any>

    Another set of capabilities to initialize this instance from.

  #### Returns Capabilities

## Methods

### [serialize]

- [serialize](): {}

- #### Returns {}

  The JSON representation of this instance. Note, the returned object may contain nested promised values.

  #### Suppress

  Suppress [] access on a struct (state inherited from Map).

### delete

- delete(key): boolean

- Deletes an entry from this set of capabilities.

  #### Parameters

  - ##### key: string

    the capability key to delete.

  #### Returns boolean

### get

- get(key): any

- #### Parameters

  - ##### key: string

    The capability to return.

  #### Returns any

  The capability with the given key, or {@code null} if it has not been set.

### getAcceptInsecureCerts

- getAcceptInsecureCerts(): boolean

- #### Returns boolean

  whether the session is configured to accept insecure TLS certificates.

### getAlertBehavior

- getAlertBehavior(): undefined | string

- #### Returns undefined | string

  the behavior pattern for responding to unhandled user prompts, or undefined if not set.

### getBrowserName

- getBrowserName(): undefined | string

- #### Returns undefined | string

  the configured browser name, or undefined if not set.

### getBrowserVersion

- getBrowserVersion(): undefined | string

- #### Returns undefined | string

  the configured browser version, or undefined if not set.

### getPageLoadStrategy

- getPageLoadStrategy(): undefined | string

- Returns the configured page load strategy.

  #### Returns undefined | string

  the page load strategy.

### getPlatform

- getPlatform(): undefined | string

- #### Returns undefined | string

  the configured platform or undefined if not set.

### getProxy

- getProxy(): undefined | ProxyConfig

- #### Returns undefined | ProxyConfig

  the configured proxy settings, or undefined if not set.

### has

- has(key): boolean

- #### Parameters

  - ##### key: string

    The capability to check.

  #### Returns boolean

  Whether the specified capability is set.

### keys

- keys(): IterableIterator<string, any, any>

- #### Returns IterableIterator<string, any, any>

  an iterator of the keys set.

### merge

- merge(other): Capabilities

- Merges another set of capabilities into this instance.

  #### Parameters

  - ##### other: {} | Capabilities | Map<string, any>

    The other set of capabilities to merge.

  #### Returns Capabilities

  A self reference.

### set

- set(key, value): Capabilities

- #### Parameters

  - ##### key: string

    The capability key.

  - ##### value: any

    The capability value.

  #### Returns Capabilities

  A self reference.

  #### Throws

  If the `key` is not a string.

### setAcceptInsecureCerts

- setAcceptInsecureCerts(accept): Capabilities

- Sets whether a WebDriver session should implicitly accept self-signed, or other untrusted TLS certificates on navigation.

  #### Parameters

  - ##### accept: boolean

    whether to accept insecure certs.

  #### Returns Capabilities

  a self reference.

### setAlertBehavior

- setAlertBehavior(behavior): Capabilities

- Sets the default action to take with an unexpected alert before returning an error. If unspecified, WebDriver will default to UserPromptHandler.DISMISS_AND_NOTIFY.

  #### Parameters

  - ##### behavior: string

    The way WebDriver should respond to unhandled user prompts.

  #### Returns Capabilities

  A self reference.

### setBrowserName

- setBrowserName(name): Capabilities

- Sets the name of the target browser.

  #### Parameters

  - ##### name: string

    the browser name.

  #### Returns Capabilities

  a self reference.

### setBrowserVersion

- setBrowserVersion(version): Capabilities

- Sets the desired version of the target browser.

  #### Parameters

  - ##### version: string

    the desired version.

  #### Returns Capabilities

  a self reference.

### setLoggingPrefs

- setLoggingPrefs(prefs): Capabilities

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

  #### Parameters

  - ##### prefs: {} | Preferences

    The logging preferences.

  #### Returns Capabilities

  A self reference.

### setPageLoadStrategy

- setPageLoadStrategy(strategy): Capabilities

- Sets the desired page loading strategy for a new WebDriver session.

  #### Parameters

  - ##### strategy: string

    the desired strategy.

  #### Returns Capabilities

  a self reference.

### setPlatform

- setPlatform(platform): Capabilities

- Sets the target platform.

  #### Parameters

  - ##### platform: string

    the target platform.

  #### Returns Capabilities

  a self reference.

### setProxy

- setProxy(proxy): Capabilities

- Sets the proxy configuration for this instance.

  #### Parameters

  - ##### proxy: ProxyConfig

    The desired proxy configuration.

  #### Returns Capabilities

  A self reference.

### `Static` chrome

- chrome(): Capabilities

- #### Returns Capabilities

  A basic set of capabilities for Chrome.

### `Static` edge

- edge(): Capabilities

- #### Returns Capabilities

  A basic set of capabilities for Microsoft Edge.

### `Static` firefox

- firefox(): Capabilities

- #### Returns Capabilities

  A basic set of capabilities for Firefox.

### `Static` ie

- ie(): Capabilities

- #### Returns Capabilities

  A basic set of capabilities for Internet Explorer.

### `Static` safari

- safari(): Capabilities

- #### Returns Capabilities

  A basic set of capabilities for Safari.

Generated using TypeDoc