- Source
Interfaces
Members
args :!Array.<string>|undefined
Command line arguments for the child process, if any.
- !Array.<string> |
undefined
- Source
env :!Object.<string, string>|undefined
Environment variables for the spawned process. If unspecified, the child will inherit this process' environment.
- !Object.<string, string> |
undefined
- Source
stdio :string|!Array.<(string|number|!stream.Stream|null|undefined)>|undefined
IO conifguration for the spawned server child process. If unspecified, the child process' IO output will be ignored.
- string |
!Array.<(string|number|!stream.Stream|null|undefined)> | undefined
- Source
Methods
addCookie(specnon-null) → (non-null) {Promise.<void>}
Adds a cookie.
Sample Usage:
// Set a basic cookie.
driver.manage().addCookie({name: 'foo', value: 'bar'});
// Set a cookie that expires in 10 minutes.
let expiry = new Date(Date.now() + (10 * 60 * 1000));
driver.manage().addCookie({name: 'foo', value: 'bar', expiry});
// The cookie expiration may also be specified in seconds since epoch.
driver.manage().addCookie({
name: 'foo',
value: 'bar',
expiry: Math.floor(Date.now() / 1000)
});
| Name | Type | Description |
|---|---|---|
spec | Options. | Defines the cookie to add. |
- Source
if any of the cookie parameters are invalid.
- Type
- error.
InvalidArgumentError
if
specis not a cookie object.- Type
- TypeError
A promise that will be resolved when the cookie has been added to the page.
- Type:
- Promise.<void>
deleteAllCookies() → (non-null) {Promise.<void>}
Deletes all cookies visible to the current page.
- Source
A promise that will be resolved when all cookies have been deleted.
- Type:
- Promise.<void>
deleteCookie(name) → (non-null) {Promise.<void>}
Deletes 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.
| Name | Type | Description |
|---|---|---|
name | string | The name of the cookie to delete. |
- Source
A promise that will be resolved when the cookie has been deleted.
- Type:
- Promise.<void>
(async) getCookie(name) → (non-null) {Promise.<?Options.Cookie>}
Retrieves 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.
| Name | Type | Description |
|---|---|---|
name | string | The name of the cookie to retrieve. |
- Source
- If the cookie name is empty or invalid.
if there is no such cookie.
- Type
- error.
NoSuchCookieError
A promise that will be resolved with the named cookie
- Type:
- Promise.<?Options.Cookie>
getCookies() → (non-null) {Promise.<!Array.<!Options.Cookie>>}
Retrieves all cookies visible to the current page. Each cookie will be returned as a JSON object as described by the WebDriver wire protocol.
- Source
A promise that will be resolved with the cookies visible to the current browsing context.
- Type:
- Promise.<!Array.<!Options.Cookie>>
getTimeouts() → (non-null) {Promise.<{script: number, pageLoad: number, implicit: number}>}
Fetches the timeouts currently configured for the current session.
- Source
A promise that will be resolved with the timeouts currently configured for the current session.
- Type:
- Promise.<{script: number, pageLoad: number, implicit: number}>
logs() → (non-null) {Logs}
- Source
The interface for managing driver logs.
- Type:
- Logs
setTimeouts(conf) → (non-null) {Promise.<void>}
Sets the timeout durations associated with the current session.
The following timeouts are supported (all timeouts are specified in milliseconds):
implicitspecifies the maximum amount of time to wait for an element locator to succeed when locating elements on the page. Defaults to 0 milliseconds.pageLoadspecifies the maximum amount of time to wait for a page to finishing loading. Defaults to 300000 milliseconds.scriptspecifies the maximum amount of time to wait for an evaluated script to run. If set tonull, the script timeout will be indefinite. Defaults to 30000 milliseconds.
| Name | Type | Description |
|---|---|---|
conf | Object | The desired timeout configuration. |
- Source
if an invalid options object is provided.
- Type
- TypeError
A promise that will be resolved when the timeouts have been set.
- Type:
- Promise.<void>
window() → (non-null) {Window}
- Source
The interface for managing the current window.
- Type:
- Window