# Class Builder

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

#### Hierarchy

- Builder
  - ServiceBuilder
  - ServiceBuilder
  - ServiceBuilder
  - ServiceBuilder

#####
Index

### Constructors

constructor

### Methods

addArguments
build
setEnvironment
setHostname
setLoopback
setPath
setPort
setStdio

## Constructors

### constructor

- new Builder(exe): Builder

- #### 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 Builder

  #### Throws

  If the provided executable path does not exist.

## Methods

### addArguments

- addArguments(...var_args): Builder

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

  #### Parameters

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

    The arguments to include.

  #### Returns 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): 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: null | Map<string, string> | {
    [name: string]: string;
    }

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

  #### Returns Builder

  A self reference.

### setHostname

- setHostname(hostname): Builder

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

  #### Parameters

  - ##### hostname: string

  #### Returns Builder

  A self reference.

### setLoopback

- setLoopback(loopback): Builder

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

  #### Parameters

  - ##### loopback: boolean

  #### Returns Builder

  A self reference.

### setPath

- setPath(basePath): Builder

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

  #### Parameters

  - ##### basePath: null | string

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

  #### Returns Builder

  A self reference.

### setPort

- setPort(port): Builder

- Sets the port to start the server on.

  #### Parameters

  - ##### port: number

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

  #### Returns Builder

  A self reference.

  #### Throws

  If an invalid port is specified.

### setStdio

- setStdio(config): Builder

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

  #### Parameters

  - ##### config: any

    The desired IO configuration.

  #### Returns Builder

  A self reference.

  #### See

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

Generated using TypeDoc