Capabilities

Describes a set of capabilities for a WebDriver session.

Constructor

new Capabilities(otheropt)

Parameters:
NameTypeAttributesDescription
otherCapabilities | Map.<string, ?> | Object<optional>

Another set of capabilities to initialize this instance from.

Members

size

Methods

delete(key)

Deletes an entry from this set of capabilities.

Parameters:
NameTypeDescription
keystring

the capability key to delete.

get(key) → {T}

Parameters:
NameTypeDescription
keystring

the parameter key to get.

Returns:

the stored parameter value.

Type: 
T

getAcceptInsecureCerts() → {boolean}

Returns:

whether the session is configured to accept insecure TLS certificates.

Type: 
boolean

getAlertBehavior() → {UserPromptHandler|undefined}

Returns:

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

Type: 
UserPromptHandler | undefined

getBrowserName() → {string|undefined}

Returns:

the configured browser name, or undefined if not set.

Type: 
string | undefined

getBrowserVersion() → {string|undefined}

Returns:

the configured browser version, or undefined if not set.

Type: 
string | undefined

getPageLoadStrategy() → {string|undefined}

Returns the configured page load strategy.

Returns:

the page load strategy.

Type: 
string | undefined

getPlatform() → {string|undefined}

Returns:

the configured platform or undefined if not set.

Type: 
string | undefined

getProxy() → {proxy.Config|undefined}

Returns:

the configured proxy settings, or undefined if not set.

Type: 
proxy.Config | undefined

has(key) → {boolean}

Parameters:
NameTypeDescription
keystring

the key to test.

Returns:

whether this capability set has the specified key.

Type: 
boolean

keys() → (non-null) {Iterator.<string>}

Returns:

an iterator of the keys set.

Type: 
Iterator.<string>

merge(othernon-null) → (non-null) {Capabilities}

Merges another set of capabilities into this instance.

Parameters:
NameTypeDescription
otherCapabilities | Map.<String, ?> | Object.<string, ?>

The other set of capabilities to merge.

Returns:

A self reference.

Type: 
Capabilities

set(key, value) → (non-null) {Capabilities}

Parameters:
NameTypeDescription
keystring

The capability key.

value*

The capability value.

Throws:

If the key is not a string.

Type
TypeError
Returns:

A self reference.

Type: 
Capabilities

setAcceptInsecureCerts(accept) → (non-null) {Capabilities}

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

Parameters:
NameTypeDescription
acceptboolean

whether to accept insecure certs.

Returns:

a self reference.

Type: 
Capabilities

setAlertBehavior(behaviornullable) → (non-null) {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:
NameTypeAttributesDescription
behaviorUserPromptHandler<nullable>

The way WebDriver should respond to unhandled user prompts.

Returns:

A self reference.

Type: 
Capabilities

setBrowserName(name) → (non-null) {Capabilities}

Sets the name of the target browser.

Parameters:
NameTypeDescription
nameBrowser | string

the browser name.

Returns:

a self reference.

Type: 
Capabilities

setBrowserVersion(version) → (non-null) {Capabilities}

Sets the desired version of the target browser.

Parameters:
NameTypeDescription
versionstring

the desired version.

Returns:

a self reference.

Type: 
Capabilities

setLoggingPrefs(prefs) → (non-null) {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:
NameTypeDescription
prefs
Returns:

A self reference.

Type: 
Capabilities

setPageLoadStrategy(strategy) → (non-null) {Capabilities}

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

Parameters:
NameTypeDescription
strategyPageLoadStrategy

the desired strategy.

Returns:

a self reference.

Type: 
Capabilities

setPlatform(platform) → (non-null) {Capabilities}

Sets the target platform.

Parameters:
NameTypeDescription
platformPlatform | string

the target platform.

Returns:

a self reference.

Type: 
Capabilities

setProxy(proxy) → (non-null) {Capabilities}

Sets the proxy configuration for this instance.

Parameters:
NameTypeDescription
proxyproxy.Config

The desired proxy configuration.

Returns:

A self reference.

Type: 
Capabilities

setStrictFileInteractability()

Sets the boolean flag configuration for this instance.

(static) chrome() → (non-null) {Capabilities}

Returns:

A basic set of capabilities for Chrome.

Type: 
Capabilities

(static) edge() → (non-null) {Capabilities}

Returns:

A basic set of capabilities for Microsoft Edge.

Type: 
Capabilities

(static) firefox() → (non-null) {Capabilities}

Returns:

A basic set of capabilities for Firefox.

Type: 
Capabilities

(static) ie() → (non-null) {Capabilities}

Returns:

A basic set of capabilities for Internet Explorer.

Type: 
Capabilities

(static) safari() → (non-null) {Capabilities}

Returns:

A basic set of capabilities for Safari.

Type: 
Capabilities