# Class ServiceBuilder

Creates remote.DriverService instances that manage a MicrosoftEdgeDriver server in a child process.

#### Hierarchy

- Builder
  - ServiceBuilder

#####
Index

### Constructors

constructor

### Methods

addArguments
build
setEnvironment
setHostname
setLoopback
setPath
setPort
setStdio

## Constructors

### constructor

- new ServiceBuilder(opt_exe?): ServiceBuilder

- #### Parameters

  - ##### `Optional` opt_exe: string

    Path to the server executable to use. If omitted, the builder will attempt to locate the MicrosoftEdgeDriver on the current PATH.

  #### Returns ServiceBuilder

  #### Throws

  If provided executable does not exist, or the MicrosoftEdgeDriver cannot be found on the PATH.

  Overrides Builder.constructor

## Methods

### addArguments

- addArguments(...var_args): ServiceBuilder

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

  #### Parameters

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

    The arguments to include.

  #### Returns ServiceBuilder

  A self reference.

  Inherited from Builder.addArguments

### build

- build(): DriverService

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

  #### Returns DriverService

  A new driver service.

  Inherited from Builder.build

### setEnvironment

- setEnvironment(env): ServiceBuilder

- 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 ServiceBuilder

  A self reference.

  Inherited from Builder.setEnvironment

### setHostname

- setHostname(hostname): ServiceBuilder

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

  #### Parameters

  - ##### hostname: string

  #### Returns ServiceBuilder

  A self reference.

  Inherited from Builder.setHostname

### setLoopback

- setLoopback(loopback): ServiceBuilder

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

  #### Parameters

  - ##### loopback: boolean

  #### Returns ServiceBuilder

  A self reference.

  Inherited from Builder.setLoopback

### setPath

- setPath(basePath): ServiceBuilder

- 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 ServiceBuilder

  A self reference.

  Inherited from Builder.setPath

### setPort

- setPort(port): ServiceBuilder

- Sets the port to start the server on.

  #### Parameters

  - ##### port: number

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

  #### Returns ServiceBuilder

  A self reference.

  #### Throws

  If an invalid port is specified.

  Inherited from Builder.setPort

### setStdio

- setStdio(config): ServiceBuilder

- 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 ServiceBuilder

  A self reference.

  #### See

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

  Inherited from Builder.setStdio

Generated using TypeDoc