Class WebDriverOptions

Provides methods for managing browser and driver state.

Index

Constructor methods

Methods

Constructor methods

constructor(driver: WebDriver): WebDriverOptions

constructor

Parameters

Returns

WebDriverOptions

Methods

public addCookie(name: string, value: string, opt_path?: string, opt_domain?: string, opt_isSecure?: boolean, opt_expiry?: number): Promise

Schedules a command to add a cookie.

Parameters

  • name: string

    The cookie name.

  • value: string

    The cookie value.

  • opt_path?: string optional

    The cookie path.

  • opt_domain?: string optional

    The cookie domain.

  • opt_isSecure?: boolean optional

    Whether the cookie is secure.

  • opt_expiry?: number optional

    When the cookie expires. If specified as a number, should be in milliseconds since midnight, January 1, 1970 UTC.

Returns

Promise

A promise that will be resolved when the cookie has been added to the page.

public addCookie(name: string, value: string, opt_path?: string, opt_domain?: string, opt_isSecure?: boolean, opt_expiry?: Date): Promise

Parameters

  • name: string
  • value: string
  • opt_path?: string optional
  • opt_domain?: string optional
  • opt_isSecure?: boolean optional
  • opt_expiry?: Date optional

Returns

Promise

public deleteAllCookies(): Promise

Schedules a command to delete all cookies visible to the current page.

Returns

Promise

A promise that will be resolved when all cookies have been deleted.

public deleteCookie(name: string): Promise

Schedules a command to delete the cookie with the given name. This command is a no-op if there is no cookie with the given name visible to the current page.

Parameters

  • name: string

    The name of the cookie to delete.

Returns

Promise

A promise that will be resolved when the cookie has been deleted.

public getCookie(name: string): Promise

Schedules a command to retrieve the cookie with the given name. Returns null if there is no such cookie. The cookie will be returned as a JSON object as described by the WebDriver wire protocol.

see

http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object

Parameters

  • name: string

    The name of the cookie to retrieve.

Returns

Promise

A promise that will be resolved with the named cookie, or {@code null} if there is no such cookie.

public getCookies(): Promise

Schedules a command to retrieve all cookies visible to the current page. Each cookie will be returned as a JSON object as described by the WebDriver wire protocol.

see

http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object

Returns

Promise

A promise that will be resolved with the cookies visible to the current page.

public logs(): WebDriverLogs

Returns

WebDriverLogs

The interface for managing driver logs.

public timeouts(): WebDriverTimeouts

Returns

WebDriverTimeouts

The interface for managing driver timeouts.

public window(): WebDriverWindow

Returns

WebDriverWindow

The interface for managing the current window.