WebDriver Protocol
newSession
The New Session command creates a new WebDriver session with the endpoint node. If the creation fails, a session not created error is returned.
WebDriver Protocol command. More details can be found in the official protocol docs.
Usage
browser.newSession(capabilities)
Parameters
Name | Type | Details |
---|---|---|
capabilities | object | a JSON object, the set of capabilities that was ultimately merged and matched in the capability processing algorithm |
Returns
- <Object>
session
: Object containing sessionId and capabilities of created WebDriver session.
deleteSession
The Delete Session command closes any top-level browsing contexts associated with the current session, terminates the connection, and finally closes the current session.
WebDriver Protocol command. More details can be found in the official protocol docs.
Usage
browser.deleteSession(deleteSessionOpts)
Parameters
Name | Type | Details |
---|---|---|
deleteSessionOpts optional | object | Object containing options for the deleteSession command, e.g. { shutdownDriver: boolean } |
status
The Status command returns information about whether a remote end is in a state in which it can create new sessions and can additionally include arbitrary meta information that is specific to the implementation.
WebDriver Protocol command. More details can be found in the official protocol docs.
Usage
browser.status()
Example
loading...
Returns
- <Object>
status
: Object containing status of the driver status.
getTimeouts
The Get Timeouts command gets timeout durations associated with the current session.
WebDriver Protocol command. More details can be found in the official protocol docs.
Usage
browser.getTimeouts()
Example
loading...
Returns
- <Object>
timeouts
: Object containing timeout durations forscript
,pageLoad
andimplicit
timeouts.
setTimeouts
The Set Timeouts command sets timeout durations associated with the current session. The timeouts that can be controlled are listed in the table of session timeouts below.
WebDriver Protocol command. More details can be found in the official protocol docs.
Usage
browser.setTimeouts(implicit, pageLoad, script)
Parameters
Name | Type | Details |
---|---|---|
implicit optional | number | integer in ms for session implicit wait timeout |
pageLoad optional | number | integer in ms for session page load timeout |
script optional | number | integer in ms for session script timeout |