Module: selenium-webdriver/opera
View Source

# class ServiceBuilder

Creates `remote.DriverService` instances that manages an OperaDriver server in a child process.

## new ServiceBuilder(opt_exe)

Parameters

opt_exe`string=`

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

Throws

`Error`

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

## Instance Methods

### build()code »

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

Returns

`DriverService`

  A new driver service using this instance's current configuration.

Throws

`Error`

  If the driver exectuable was not specified and a default could not be found on the current PATH.

### enableVerboseLogging()code »

Enables verbose logging.

Returns

`ServiceBuilder`

  A self reference.

### loggingTo(path)code »

Sets the path of the log file the driver should log to. If a log file is not specified, the driver will log to stderr.

Parameters

path`string`

  Path of the log file to use.

Returns

`ServiceBuilder`

  A self reference.

### setStdio(config)code »

Defines the stdio configuration for the driver service. See `child_process.spawn` for more information.

Parameters

config`(string|Array<?(string|number|Stream)>)`

  The configuration to use.

Returns

`ServiceBuilder`

  A self reference.

### silent()code »

Silence sthe drivers output.

Returns

`ServiceBuilder`

  A self reference.

### usingPort(port)code »

Sets the port to start the OperaDriver on.

Parameters

port`number`

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

Returns

`ServiceBuilder`

  A self reference.

Throws

`Error`

  If the port is invalid.

### withEnvironment(env)code »

Defines the environment to start the server under. This settings will be inherited by every browser session started by the server.

Parameters

env`Object<string, string>`

  The environment to use.

Returns

`ServiceBuilder`

  A self reference.