# Class Executor

A command executor that communicates with the server using HTTP + JSON.

By default, each instance of this class will use the legacy wire protocol from Selenium project. The executor will automatically switch to the W3C wire protocol if the remote end returns a compliant response to a new session command.

#### Hierarchy

- Executor

#####
Index

### Constructors

constructor

### Methods

defineCommand
execute

## Constructors

### constructor

- new Executor(client): Executor

- #### Parameters

  - ##### client: HttpClient | Promise<HttpClient>

    The client to use for sending requests to the server, or a promise-like object that will resolve to to the client.

  #### Returns Executor

## Methods

### defineCommand

- defineCommand(name, method, path): void

- 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

  - ##### name: string

    The command name.

  - ##### method: string

    The HTTP method to use when sending this command.

  - ##### path: string

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

  #### Returns void

### execute

- execute(command): any

- #### Parameters

  - ##### command: any

  #### Returns any

Generated using TypeDoc