Creates DriverService objects that manage a WebDriver server in a child process.

### Hierarchy

- Builder
  - <internal>.ServiceBuilder
  - <internal>.ServiceBuilder
  - <internal>.ServiceBuilder
  - <internal>.ServiceBuilder

## Index

### Constructors

- constructor

### Methods

- addArguments
- build
- setEnvironment
- setHostname
- setLoopback
- setPath
- setPort
- setStdio

## Constructors

### constructor

- new Builder(exe: string): <internal>.Builder

- throws

    {Error} If the provided executable path does not exist.

  #### Parameters

  - ##### exe: string

    Path to the executable to use. This executable must accept the `--port` flag for defining the port to start the server on.

  #### Returns <internal>.Builder

## Methods

### addArguments

- addArguments(...var_args: string[]): <internal>.Builder

- Define additional command line arguments to use when starting the server.

  #### Parameters

  - ##### Rest ...var_args: string[]

    The arguments to include.

  #### Returns <internal>.Builder

  A self reference.

### build

- build(): DriverService

- Creates a new DriverService using this instance's current configuration.

  #### Returns DriverService

  A new driver service.

### setEnvironment

- setEnvironment(env: Map<string, string> | {}): <internal>.Builder

- Defines the environment to start the server under. This setting will be inherited by every browser session started by the server. By default, the server will inherit the enviroment of the current process.

  #### Parameters

  - ##### env: Map<string, string> | {}

    The desired environment to use, or `null` if the server should inherit the current environment.

  #### Returns <internal>.Builder

  A self reference.

### setHostname

- setHostname(hostname: string): <internal>.Builder

- Sets the host name to access the server on. If specified, the {@linkplain #setLoopback() loopback} setting will be ignored.

  #### Parameters

  - ##### hostname: string

  #### Returns <internal>.Builder

  A self reference.

### setLoopback

- setLoopback(loopback: boolean): <internal>.Builder

- Sets whether the service should be accessed at this host's loopback address.

  #### Parameters

  - ##### loopback: boolean

  #### Returns <internal>.Builder

  A self reference.

### setPath

- setPath(basePath: string): <internal>.Builder

- Sets the base path for WebDriver REST commands (e.g. "/wd/hub"). By default, the driver will accept commands relative to "/".

  #### Parameters

  - ##### basePath: string

    The base path to use, or `null` to use the default.

  #### Returns <internal>.Builder

  A self reference.

### setPort

- setPort(port: number): <internal>.Builder

- Sets the port to start the server on.

  throws

    {Error} If an invalid port is specified.

  #### Parameters

  - ##### port: number

    The port to use, or 0 for any free port.

  #### Returns <internal>.Builder

  A self reference.

### setStdio

- setStdio(config: any): <internal>.Builder

- IO configuration for the spawned server process. For more information, refer to the documentation of `child_process.spawn`.

  see

    https://nodejs.org/dist/latest-v4.x/docs/api/child_process.html#child_process_options_stdio

  #### Parameters

  - ##### config: any

    The desired IO configuration.

  #### Returns <internal>.Builder

  A self reference.

Generated using TypeDoc