Class Builder

extends

{webdriver.AbstractBuilder}

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): Builder

constructor

Returns

Builder

Properties

public static 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 {@code #useExistingSession(boolean)}. The use of this environment variable requires that {@link webdriver.AbstractBuilder.SERVER_URL_ENV} also be set.

type

{string}

const
see

webdriver.process.getEnv

Methods

public build(): WebDriver

override

Returns

WebDriver

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 getSession(): string

Returns

string

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

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 usingSession(id: string): 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

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