Class SeleniumServer

code »
DriverService
  └ SeleniumServer

Manages the life and death of the Selenium standalone server. The server may be obtained from http://selenium-release.storage.googleapis.com/index.html.

Constructor

SeleniumServer ( jar, options )
Parameters
jar: string
Path to the Selenium server jar.
options: !SeleniumServer.Options
Configuration options for the server.
Throws
Error
If an invalid port is specified.
Show:

Type Definitions

Options for the Selenium server:
  • port - The port to start the server on (must be > 0). If the port is provided as a promise, the service will wait for the promise to resolve before starting.
  • args - The arguments to pass to the service. If a promise is provided, the service will wait for it to resolve before starting.
  • jvmArgs - The arguments to pass to the JVM. If a promise is provided, the service will wait for it to resolve before starting.
  • env - The environment variables that should be visible to the server process. Defaults to inheriting the current process's environment.
  • stdio - IO configuration for the spawned server process. For more information, refer to the documentation of child_process.spawn.

Instance Methods

Returns
A promise that resolves to the server's address.
Throws
Error
If the server has not been started.
Returns
Whether the underlying service process is running.

Stops the service if it is not currently running. This function will kill the server immediately. To synchronize with the active control flow, use #stop().

Returns
A promise that will be resolved when the server has been stopped.

Starts the server if it is not already running.

Parameters
opt_timeoutMs: number=
How long to wait, in milliseconds, for the server to start accepting requests. Defaults to 30 seconds.
Returns
A promise that will resolve to the server's base URL when it has started accepting requests. If the timeout expires before the server has started, the promise will be rejected.

Schedules a task in the current control flow to stop the server if it is currently running.

Returns
A promise that will be resolved when the server has been stopped.

Instance Properties

Promise that resolves to the server's address or null if the server has not been started.

code »process_ : child_process.ChildProcess

Promise that tracks the status of shutting down the server, or null if the server is not currently shutting down.

Static Properties