selenium-webdriver/chromium~ Driver

Creates a new WebDriver client for Chromium-based browsers.

Constructor

new Driver()

Methods

deleteNetworkConditions() → (non-null) {Promise}

Schedules a command to delete Chromium network emulation settings.

Returns:

A promise that will be resolved when network emulation settings have been deleted.

Type: 
Promise

getCastIssueMessage() → (non-null) {promise.Thenable.<void>}

Returns an error message when there is any issue in a Cast session.

Returns:

A promise that will be resolved when the mirror command has been issued to the device.

Type: 
promise.Thenable.<void>

getCastSinks() → (non-null) {promise.Thenable.<void>}

Returns the list of cast sinks (Cast devices) available to the Chrome media router.

Returns:

A promise that will be resolved with an array of Strings containing the friendly device names of available cast sink targets.

Type: 
promise.Thenable.<void>

getNetworkConditions() → (non-null) {Promise}

Schedules a command to get Chromium network emulation settings.

Returns:

A promise that will be resolved when network emulation settings are retrieved.

Type: 
Promise

launchApp(id) → (non-null) {Promise.<void>}

Schedules a command to launch Chrome App with given ID.

Parameters:
NameTypeDescription
idstring

ID of the App to launch.

Returns:

A promise that will be resolved when app is launched.

Type: 
Promise.<void>

sendAndGetDevToolsCommand(cmd, paramsopt) → (non-null) {Promise.<string>}

Sends an arbitrary devtools command to the browser and get the result.

Parameters:
NameTypeAttributesDescription
cmdstring

The name of the command to send.

paramsObject<optional>

The command parameters.

Returns:

A promise that will be resolved when the command has finished.

Type: 
Promise.<string>

sendDevToolsCommand(cmd, paramsopt) → (non-null) {Promise.<void>}

Sends an arbitrary devtools command to the browser.

Parameters:
NameTypeAttributesDescription
cmdstring

The name of the command to send.

paramsObject<optional>

The command parameters.

Returns:

A promise that will be resolved when the command has finished.

Type: 
Promise.<void>

setCastSinkToUse(deviceName) → (non-null) {promise.Thenable.<void>}

Selects a cast sink (Cast device) as the recipient of media router intents (connect or play).

Parameters:
NameTypeDescription
deviceNameString

name of the target device.

Returns:

A promise that will be resolved when the target device has been selected to respond further webdriver commands.

Type: 
promise.Thenable.<void>

(async) setDownloadPath(path) → (non-null) {Promise.<void>}

Sends a DevTools command to change the browser's download directory.

Parameters:
NameTypeDescription
pathstring

The desired download directory.

Returns:

A promise that will be resolved when the command has finished.

Type: 
Promise.<void>

setFileDetector()

This function is a no-op as file detectors are not supported by this implementation.

setNetworkConditions(spec) → (non-null) {Promise.<void>}

Schedules a command to set Chromium network emulation settings.

Sample Usage:

driver.setNetworkConditions({ offline: false, latency: 5, // Additional latency (ms). download_throughput: 500 * 1024, // Maximal aggregated download throughput. upload_throughput: 500 * 1024 // Maximal aggregated upload throughput. });

Parameters:
NameTypeDescription
specObject

Defines the network conditions to set

Returns:

A promise that will be resolved when network emulation settings are set.

Type: 
Promise.<void>

setPermission(name, state) → (non-null) {Promise.<Object>}

Set a permission state to the given value.

Parameters:
NameTypeDescription
namestring

A name of the permission to update.

state"granted" | "denied" | "prompt"

State to set permission to.

Returns:

A promise that will be resolved when the command has finished.

Type: 
Promise.<Object>

startCastTabMirroring(deviceName) → (non-null) {promise.Thenable.<void>}

Initiates tab mirroring for the current browser tab on the specified device.

Parameters:
NameTypeDescription
deviceNameString

name of the target device.

Returns:

A promise that will be resolved when the mirror command has been issued to the device.

Type: 
promise.Thenable.<void>

startDesktopMirroring(deviceName) → (non-null) {promise.Thenable.<void>}

Initiates desktop mirroring for the current browser tab on the specified device.

Parameters:
NameTypeDescription
deviceNameString

name of the target device.

Returns:

A promise that will be resolved when the mirror command has been issued to the device.

Type: 
promise.Thenable.<void>

stopCasting(deviceName) → (non-null) {promise.Thenable.<void>}

Stops casting from media router to the specified device, if connected.

Parameters:
NameTypeDescription
deviceNameString

name of the target device.

Returns:

A promise that will be resolved when the stop command has been issued to the device.

Type: 
promise.Thenable.<void>

(static) createSession(capsopt, opt_serviceExecutoropt, vendorPrefix, vendorCapabilityKey) → (non-null) {Driver}

Creates a new session with the WebDriver server.

Parameters:
NameTypeAttributesDescription
capsCapabilities | Options<optional>

The configuration options.

opt_serviceExecutorremote.DriverService | http.Executor<optional>

Either a DriverService to use for the remote end, or a preconfigured executor for an externally managed endpoint. If neither is provided, the default service will be used by default.

vendorPrefix

Either 'goog' or 'ms'

vendorCapabilityKey

Either 'goog:chromeOptions' or 'ms:edgeOptions'

Returns:

A new driver instance.

Type: 
Driver