# Class webdriver.Builder

code »

    webdriver.AbstractBuilder
      └ webdriver.Builder

## Constructor

webdriver.Builder ( )
Show:Public Protected Private

## Instance Methods

### Defined in `webdriver.Builder`

code »build ( ) ⇒ `webdriver.WebDriver`
code »getSession ( ) ⇒ `string`

Returns

The ID of the session, if any, this builder is configured to reuse.

code »usingSession ( id ) ⇒ `!webdriver.AbstractBuilder`

Configures the builder to create a client that will use an existing WebDriver session.

Parameters

id: `string`
  The existing session ID to use.

Returns

This Builder instance for chain calling.

### Defined in `webdriver.AbstractBuilder`

code »getCapabilities ( ) ⇒ `!webdriver.Capabilities`

Returns

The current desired capabilities for this builder.

code »getServerUrl ( ) ⇒ `string`

Returns

The URL of the WebDriver server this instance is configured to use.

code »setLoggingPreferences ( prefs ) ⇒ `!webdriver.AbstractBuilder`

Sets the logging preferences for the created session. Preferences may be changed by repeated calls, or by calling `#withCapabilities`.

Parameters

prefs: `!(webdriver.logging.Preferences|Object.<string, string>)`
  The desired logging preferences.

Returns

This Builder instance for chain calling.

code »usingServer ( url ) ⇒ `!webdriver.AbstractBuilder`

Configures which WebDriver server should be used for new sessions. Overrides the value loaded from the `webdriver.AbstractBuilder.SERVER_URL_ENV` upon creation of this instance.

Parameters

url: `string`
  URL of the server to use.

Returns

This Builder instance for chain calling.

code »withCapabilities ( capabilities ) ⇒ `!webdriver.AbstractBuilder`

Sets the desired capabilities when requesting a new session. This will overwrite any previously set desired capabilities.

Parameters

capabilities: `!(Object|webdriver.Capabilities)`
  The desired capabilities for a new session.

Returns

This Builder instance for chain calling.

## Instance Properties

### Defined in `webdriver.Builder`

code »sessionId_ : `string`

ID of an existing WebDriver session that new clients should use. Initialized from the value of the `webdriver.AbstractBuilder.SESSION_ID_ENV` environment variable, but may be overridden using `webdriver.AbstractBuilder#usingSession`.

### Defined in `webdriver.AbstractBuilder`

code »capabilities_ : `!webdriver.Capabilities`

The desired capabilities to use when creating a new session.

code »serverUrl_ : `string`

URL of the remote server to use for new clients; initialized from the value of the `webdriver.AbstractBuilder.SERVER_URL_ENV` environment variable, but may be overridden using `webdriver.AbstractBuilder#usingServer`.

## Static Properties

code »webdriver.Builder.SESSION_ID_ENV : `string`

Environment variable that defines the session ID of an existing WebDriver session to use when creating clients. If set, all new Builder instances will default to creating clients that use this session. To create a new session, use `#useExistingSession(boolean)`. The use of this environment variable requires that `webdriver.AbstractBuilder.SERVER_URL_ENV` also be set.

code »webdriver.Builder.superClass_ : `webdriver.AbstractBuilder.prototype`