Class AbstractBuilder

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

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

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): AbstractBuilder

constructor

Returns

AbstractBuilder

Properties

public static DEFAULT_SERVER_URL: string

The default URL of the WebDriver server to use if {@link webdriver.AbstractBuilder.SERVER_URL_ENV} is not set.

type

{string}

const

public static 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 {@code #usingServer(url)}.

type

{string}

const
see

webdriver.process.getEnv

Methods

public build(): WebDriver

Builds a new {@link webdriver.WebDriver} instance using this builder's current configuration.

Returns

WebDriver

A new WebDriver client.

public getCapabilities(): Capabilities

Returns

Capabilities

The current desired capabilities for this builder.

public getServerUrl(): string

Returns

string

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

public usingServer(url: string): AbstractBuilder

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

Parameters

  • url: string

    URL of the server to use.

Returns

AbstractBuilder

This Builder instance for chain calling.

public withCapabilities(capabilities: Capabilities): AbstractBuilder

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

Parameters

  • capabilities: Capabilities

    The desired capabilities for a new session.

Returns

AbstractBuilder

This Builder instance for chain calling.

public withCapabilities(capabilities: any): AbstractBuilder

Parameters

  • capabilities: any

Returns

AbstractBuilder