Sessions
newSession(options)
Before we can send any command to the browser we drive we need to create a WebDriver session. This should be always the first step of interaction through the protocol. After executing this command the browser will be started and ready to receive the commands. As part of session creation we have to provide the url of WebDriver protocol compliant server. This can be a locally running browser driver server (Chromedriver, Geckodriver, etc.), Selenium Server or Grid or cloud provider url (BrowserStack, Sauce Labs, .etc.). Also we can set the browser and operating system parameters we want to interact with.
PARAMETERS
options
: SessionOptions - Object with configuration for new session creation
RETURNS
Promise<Session>
EXAMPLES
SEE ALSO
status(url)
To be able to verify if the WebDriver server is ready for new session creation sometimes it can be useful to query it's status. This function queries the WebDriver server's current status. The status contains meta information about the WebDriver server and operating system.
PARAMETERS
url
: string - Location of WebDriver API
RETURNS
Promise<Status>
EXAMPLES
SEE ALSO
Session
This object represents a WebDriver session.
SEE ALSO
session.close()
Close the session.
RETURNS
Promise<void>
EXAMPLES
SEE ALSO
SessionOptions
PROPERTIES
url
: string - WebDriver server URLcapabilities
: Capabilities - WebDriver capabilitiesdesiredCapabilities?
: object - Legacy WebDriver capabilities. Can be used to enable the new W3C dialectbrowserstack.use_w3c
: boolean
headers?
: Headers - Session creation request headers. Can be used for authorization.
Status
WebDriver status object
PROPERTIES
message
: stringready
: booleanos
: StatusOfOSbuild
: StatusOfWebDriver
StatusOfOS
PROPERTIES
name
: string - Name of operating systemversion
: string - Version of operating systemarch
: string - Operating system architecture
StatusOfWebDriver
PROPERTIES
version
: string - Version of driver
Last updated