Executor

Handles the execution of WebDriver commands.

Methods

defineCommand(name, method, path)

Defines a new command for use with this executor. When a command is sent, the {@code path} will be preprocessed using the command's parameters; any path segments prefixed with ":" will be replaced by the parameter of the same name. For example, given "/person/:name" and the parameters "{name: 'Bob'}", the final command path will be "/person/Bob".

Parameters:
NameTypeDescription
namestring

The command name.

methodstring

The HTTP method to use when sending this command.

pathstring

The path to send the command to, relative to the WebDriver server's command root and of the form "/path/:variable/segment".

execute(commandnon-null) → (non-null) {Promise.<?>}

Executes the given {@code command}. If there is an error executing the command, the provided callback will be invoked with the offending error. Otherwise, the callback will be invoked with a null Error and non-null response object.

Parameters:
NameTypeDescription
commandCommand

The command to execute.

Returns:

A promise that will be fulfilled with the command result.

Type: 
Promise.<?>

(async) execute()