# Class webdriver.AbstractBuilder

code »

Creates new `webdriver.WebDriver` clients. Upon instantiation, each Builder will configure itself based on the following environment variables:

`webdriver.AbstractBuilder.SERVER_URL_ENV`
  Defines the remote WebDriver server that should be used for command command execution; may be overridden using `webdriver.AbstractBuilder.prototype.usingServer`.

## Constructor

webdriver.AbstractBuilder ( )
Show:Public Protected Private

## Instance Methods

code »build ( ) ⇒ `!webdriver.WebDriver`

Builds a new `webdriver.WebDriver` instance using this builder's current configuration.

Returns

A new WebDriver client.

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

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.AbstractBuilder.DEFAULT_SERVER_URL : `string`

The default URL of the WebDriver server to use if `webdriver.AbstractBuilder.SERVER_URL_ENV` is not set.

code »webdriver.AbstractBuilder.SERVER_URL_ENV : `string`

Environment variable that defines the URL of the WebDriver server that should be used for all new WebDriver clients. This setting may be overridden using `#usingServer(url)`.