class Executor

Alias for webdriver.http.Executor
All implemented interfaces
webdriver.CommandExecutor

A command executor that communicates with a server using the WebDriver command protocol.

new Executor(client)

Parameters
clientwebdriver.http.Client

The client to use when sending requests to the server.

Instance Methods

defineCommand(name, method, path)code »

Defines a new command for use with this executor. When a command is sent, the 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
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(command, callback)code »

Executes the given 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 bot.response.ResponseObject object.

Specified by: webdriver.CommandExecutor

Parameters
commandwebdriver.Command

The command to execute.

callbackfunction(Error, {status: number, value: *}=): ?

the function to invoke when the command response is ready.