The endpoints and payloads for the now-obsolete open source protocol that was the precursor to the
W3C specification.
This documentation previously located on the wiki
All implementations of WebDriver that communicate with the browser, or a RemoteWebDriver server shall use a common wire protocol. This wire protocol defines a RESTful web service using JSON over HTTP.
The protocol will assume that the WebDriver API has been “flattened”, but there is an expectation that client implementations will take a more Object-Oriented approach, as demonstrated in the existing Java API. The wire protocol is implemented in request/response pairs of “commands” and “responses”.
Terms and Concepts ClientThe machine on which the WebDriver API is being used.
SessionThe machine running the RemoteWebDriver. This term may also refer to a specific browser that implements the wire protocol directly, such as the FirefoxDriver or IPhoneDriver.
The server should maintain one browser per session. Commands sent to a session will be directed to the corresponding browser.
WebElementAn object in the WebDriver API that represents a DOM element on the page.
WebElement JSON ObjectThe JSON representation of a WebElement for transmission over the wire. This object will have the following properties:
Key Type Description ELEMENT string The opaque ID assigned to the element by the server. This ID should be used in all subsequent commands issued against the element. Capabilities JSON ObjectNot all server implementations will support every WebDriver feature. Therefore, the client and server should use JSON objects with the properties listed below when describing which features a session supports.
Key Type Description browserName string The name of the browser being used; should be one of{android, chrome, firefox, htmlunit, internet explorer, iPhone, iPad, opera, safari}
. version string The browser version, or the empty string if unknown. platform string A key specifying which platform the browser is running on. This value should be one of {WINDOWS|XP|VISTA|MAC|LINUX|UNIX}
. When requesting a new session, the client may specify ANY
to indicate any available platform may be used. javascriptEnabled boolean Whether the session supports executing user supplied JavaScript in the context of the current page. takesScreenshot boolean Whether the session supports taking screenshots of the current page. handlesAlerts boolean Whether the session can interact with modal popups, such as window.alert
and window.confirm
. databaseEnabled boolean Whether the session can interact database storage. locationContextEnabled boolean Whether the session can set and query the browser's location context. applicationCacheEnabled boolean Whether the session can interact with the application cache. browserConnectionEnabled boolean Whether the session can query for the browser's connectivity and disable it if desired. cssSelectorsEnabled boolean Whether the session supports CSS selectors when searching for elements. webStorageEnabled boolean Whether the session supports interactions with storage objects. rotatable boolean Whether the session can rotate the current page's current layout between portrait and landscape orientations (only applies to mobile platforms). acceptSslCerts boolean Whether the session should accept all SSL certs by default. nativeEvents boolean Whether the session is capable of generating native events when simulating user input. proxy proxy object Details of any proxy to use. If no proxy is specified, whatever the system's current or default state is used. The format is specified under Proxy JSON Object. unexpectedAlertBehaviour string What the browser should do with an unhandled alert before throwing out the UnhandledAlertException. Possible values are "accept", "dismiss" and "ignore" elementScrollBehavior integer Allows the user to specify whether elements are scrolled into the viewport for interaction to align with the top (0) or bottom (1) of the viewport. The default value is to align with the top of the viewport. Supported in IE and Firefox (since 2.36) Desired Capabilities
A Capabilities JSON Object sent by the client describing the capabilities a new session created by the server should possess. Any omitted keys implicitly indicate the corresponding capability is irrelevant. More at DesiredCapabilities.
Actual CapabilitiesA Capabilities JSON Object returned by the server describing what features a session actually supports. Any omitted keys implicitly indicate the corresponding capability is not supported.
Cookie JSON ObjectA JSON object describing a Cookie.
Key Type Description name string The name of the cookie. value string The cookie value. path string (Optional) The cookie path.1 domain string (Optional) The domain the cookie is visible to.1 secure boolean (Optional) Whether the cookie is a secure cookie.1 httpOnly boolean (Optional) Whether the cookie is an httpOnly cookie.1 expiry number (Optional) When the cookie expires, specified in seconds since midnight, January 1, 1970 UTC.11 When returning Cookie objects, the server should only omit an optional field if it is incapable of providing the information.
Log Entry JSON ObjectA JSON object describing a log entry.
Key Type Description timestamp number The timestamp of the entry. level string The log level of the entry, for example, "INFO" (see log levels). message string The log message. Log LevelsLog levels in order, with finest level on top and coarsest level at the bottom.
Level Description ALL All log messages. Used for fetching of logs and configuration of logging. DEBUG Messages for debugging. INFO Messages with user information. WARNING Messages corresponding to non-critical problems. SEVERE Messages corresponding to critical errors. OFF No log messages. Used for configuration of logging. Log TypeThe table below lists common log types. Other log types, for instance, for performance logging may also be available.
Log Type Description client Logs from the client. driver Logs from the webdriver. browser Logs from the browser. server Logs from the server. Proxy JSON ObjectA JSON object describing a Proxy configuration.
Key Type Description proxyType string (Required) The type of proxy being used. Possible values are: direct - A direct connection - no proxy in use, manual - Manual proxy settings configured, e.g. setting a proxy for HTTP, a proxy for FTP, etc, pac - Proxy autoconfiguration from a URL, autodetect - Proxy autodetection, probably with WPAD, system - Use system settings proxyAutoconfigUrl string (Required if proxyType == pac, Ignored otherwise) Specifies the URL to be used for proxy autoconfiguration. Expected format example: http://hostname.com:1234/pacfile ftpProxy, httpProxy, sslProxy, socksProxy string (Optional, Ignored if proxyType != manual) Specifies the proxies to be used for FTP, HTTP, HTTPS and SOCKS requests respectively. Behaviour is undefined if a request is made, where the proxy for the particular protocol is undefined, if proxyType is manual. Expected format example: hostname.com:1234 socksUsername string (Optional, Ignored if proxyType != manual and socksProxy is not set) Specifies SOCKS proxy username. socksPassword string (Optional, Ignored if proxyType != manual and socksProxy is not set) Specifies SOCKS proxy password. noProxy string (Optional, Ignored if proxyType != manual) Specifies proxy bypass addresses. Format is driver specific. Messages CommandsWebDriver command messages should conform to the HTTP/1.1 request specification. Although the server may be extended to respond to other content-types, the wire protocol dictates that all commands accept a content-type of application/json;charset=UTF-8
. Likewise, the message bodies for POST and PUT request must use an application/json;charset=UTF-8
content-type.
Each command in the WebDriver service will be mapped to an HTTP method at a specific path. Path segments prefixed with a colon (:) indicate that segment is a variable used to further identify the underlying resource. For example, consider an arbitrary resource mapped as:
GET /favorite/color/:name
Given this mapping, the server should respond to GET requests sent to “/favorite/color/Jack” and “/favorite/color/Jill”, with the variable :name
set to “Jack” and “Jill”, respectively.
Command responses shall be sent as HTTP/1.1 response messages. If the remote server must return a 4xx response, the response body shall have a Content-Type of text/plain and the message body shall be a descriptive message of the bad request. For all other cases, if a response includes a message body, it must have a Content-Type of application/json;charset=UTF-8 and will be a JSON object with the following properties:
Key Type Description sessionId string null status number A status code summarizing the result of the command. A non-zero value indicates that the command failed. value*
The response JSON value. Response Status Codes
The wire protocol will inherit its status codes from those used by the InternetExplorerDriver:
Code Summary Detail 0Success
The command executed successfully. 6 NoSuchDriver
A session is either terminated or not started 7 NoSuchElement
An element could not be located on the page using the given search parameters. 8 NoSuchFrame
A request to switch to a frame could not be satisfied because the frame could not be found. 9 UnknownCommand
The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource. 10 StaleElementReference
An element command failed because the referenced element is no longer attached to the DOM. 11 ElementNotVisible
An element command could not be completed because the element is not visible on the page. 12 InvalidElementState
An element command could not be completed because the element is in an invalid state (e.g. attempting to click a disabled element). 13 UnknownError
An unknown server-side error occurred while processing the command. 15 ElementIsNotSelectable
An attempt was made to select an element that cannot be selected. 17 JavaScriptError
An error occurred while executing user supplied JavaScript. 19 XPathLookupError
An error occurred while searching for an element by XPath. 21 Timeout
An operation did not complete before its timeout expired. 23 NoSuchWindow
A request to switch to a different window could not be satisfied because the window could not be found. 24 InvalidCookieDomain
An illegal attempt was made to set a cookie under a different domain than the current page. 25 UnableToSetCookie
A request to set a cookie’s value could not be satisfied. 26 UnexpectedAlertOpen
A modal dialog was open, blocking this operation 27 NoAlertOpenError
An attempt was made to operate on a modal dialog when one was not open. 28 ScriptTimeout
A script did not complete before its timeout expired. 29 InvalidElementCoordinates
The coordinates provided to an interactions operation are invalid. 30 IMENotAvailable
IME was not available. 31 IMEEngineActivationFailed
An IME engine could not be started. 32 InvalidSelector
Argument was an invalid selector (e.g. XPath/CSS). 33 SessionNotCreatedException
A new session could not be created. 34 MoveTargetOutOfBounds
Target provided for a move action is out of bounds.
The client should interpret a 404 Not Found response from the server as an “Unknown command” response. All other 4xx and 5xx responses from the server that do not define a status field should be interpreted as “Unknown error” responses.
Error HandlingThere are two levels of error handling specified by the wire protocol: invalid requests and failed commands.
Invalid RequestsAll invalid requests should result in the server returning a 4xx HTTP response. The response Content-Type should be set to text/plain and the message body should be a descriptive error message. The categories of invalid requests are as follows:
404 Not Found
message.
501 Not Implemented
error message. Note this is the only error in the Invalid Request category that does not return a 4xx
status code.
404 Not Found
. For example, if ID my-session
is not a valid session ID on the server, and a command is sent to GET /session/my-session HTTP/1.1
, then the server should gracefully return a 404
.
405 Method Not Allowed
. The response must include an Allows header with a list of the allowed methods for the requested resource.
400 Bad Request
. The response body should list the missing parameters.
If a request maps to a valid command and contains all of the expected parameters in the request body, yet fails to execute successfully, then the server should send a 500 Internal Server Error. This response should have a Content-Type of application/json;charset=UTF-8
and the response body should be a well formed JSON response object.
The response status should be one of the defined status codes and the response value should be another JSON object with detailed information for the failing command:
Key Type Description message string A descriptive message for the command failure. screen string (Optional) If included, a screenshot of the current page as a base64 encoded string. class string (Optional) If included, specifies the fully qualified class name for the exception that was thrown when the command failed. stackTrace array (Optional) If included, specifies an array of JSON objects describing the stack trace for the exception that was thrown when the command failed. The zeroeth element of the array represents the top of the stack.Each JSON object in the stackTrace array must contain the following properties:
Key Type Description fileName string The name of the source file containing the line represented by this frame. className string The fully qualified class name for the class active in this frame. If the class name cannot be determined, or is not applicable for the language the server is implemented in, then this property should be set to the empty string. methodName string The name of the method active in this frame, or the empty string if unknown/not applicable. lineNumber number The line number in the original source file for the frame, or 0 if unknown. Resource MappingResources in the WebDriver REST service are mapped to individual URL patterns. Each resource may respond to one or more HTTP request methods. If a resource responds to a GET request, then it should also respond to HEAD requests. All resources should respond to OPTIONS requests with an Allow
header field, whose value is a list of all methods that resource responds to.
If a resource is mapped to a URL containing a variable path segment name, that path segment should be used to further route the request. Variable path segments are indicated in the resource mapping by a colon-prefix. For example, consider the following:
/favorite/color/:person
A resource mapped to this URL should parse the value of the :person
path segment to further determine how to respond to the request. If this resource received a request for /favorite/color/Jack
, then it should return Jack’s favorite color. Likewise, the server should return Jill’s favorite color for any requests to /favorite/color/Jill
.
Two resources may only be mapped to the same URL pattern if one of those resources’ patterns contains variable path segments, and the other does not. In these cases, the server should always route requests to the resource whose path is the best match for the request. Consider the following two resource paths:
/session/:sessionId/element/active
/session/:sessionId/element/:id
Given these mappings, the server should always route requests whose final path segment is active to the first resource. All other requests should be routed to second.
Command Reference Command Summary HTTP Method Path Summary GET /status Query the server’s current status. POST /session Create a new session. GET /sessions Returns a list of the currently active sessions. GET /session/:sessionId Retrieve the capabilities of the specified session. DELETE /session/:sessionId Delete the session. POST /session/:sessionId/timeouts Configure the amount of time that a particular type of operation can execute for before they are aborted and a POST /session/:sessionId/timeouts/async_script Set the amount of time, in milliseconds, that asynchronous scripts executed by/session/:sessionId/execute_async
are permitted to run before they are aborted and a POST /session/:sessionId/timeouts/implicit_wait Set the amount of time the driver should wait when searching for elements. GET /session/:sessionId/window_handle Retrieve the current window handle. GET /session/:sessionId/window_handles Retrieve the list of all window handles available to the session. GET /session/:sessionId/url Retrieve the URL of the current page. POST /session/:sessionId/url Navigate to a new URL. POST /session/:sessionId/forward Navigate forwards in the browser history, if possible. POST /session/:sessionId/back Navigate backwards in the browser history, if possible. POST /session/:sessionId/refresh Refresh the current page. POST /session/:sessionId/execute Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. POST /session/:sessionId/execute_async Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. GET /session/:sessionId/screenshot Take a screenshot of the current page. GET /session/:sessionId/ime/available_engines List all available engines on the machine. GET /session/:sessionId/ime/active_engine Get the name of the active IME engine. GET /session/:sessionId/ime/activated Indicates whether IME input is active at the moment (not if it’s available. POST /session/:sessionId/ime/deactivate De-activates the currently-active IME engine. POST /session/:sessionId/ime/activate Make an engines that is available (appears on the listreturned by getAvailableEngines) active. POST /session/:sessionId/frame Change focus to another frame on the page. POST /session/:sessionId/frame/parent Change focus to the parent context. POST /session/:sessionId/window Change focus to another window. DELETE /session/:sessionId/window Close the current window. POST /session/:sessionId/window/:windowHandle/size Change the size of the specified window. GET /session/:sessionId/window/:windowHandle/size Get the size of the specified window. POST /session/:sessionId/window/:windowHandle/position Change the position of the specified window. GET /session/:sessionId/window/:windowHandle/position Get the position of the specified window. POST /session/:sessionId/window/:windowHandle/maximize Maximize the specified window if not already maximized. GET /session/:sessionId/cookie Retrieve all cookies visible to the current page. POST /session/:sessionId/cookie Set a cookie. DELETE /session/:sessionId/cookie Delete all cookies visible to the current page. DELETE /session/:sessionId/cookie/:name Delete the cookie with the given name. GET /session/:sessionId/source Get the current page source. GET /session/:sessionId/title Get the current page title. POST /session/:sessionId/element Search for an element on the page, starting from the document root. POST /session/:sessionId/elements Search for multiple elements on the page, starting from the document root. POST /session/:sessionId/element/active Get the element on the page that currently has focus. GET /session/:sessionId/element/:id Describe the identified element. POST /session/:sessionId/element/:id/element Search for an element on the page, starting from the identified element. POST /session/:sessionId/element/:id/elements Search for multiple elements on the page, starting from the identified element. POST /session/:sessionId/element/:id/click Click on an element. POST /session/:sessionId/element/:id/submit Submit a FORM
element. GET /session/:sessionId/element/:id/text Returns the visible text for the element. POST /session/:sessionId/element/:id/value Send a sequence of key strokes to an element. POST /session/:sessionId/keys Send a sequence of key strokes to the active element. GET /session/:sessionId/element/:id/name Query for an element’s tag name. POST /session/:sessionId/element/:id/clear Clear a TEXTAREA
or text INPUT
element’s value. GET /session/:sessionId/element/:id/selected Determine if an OPTION
element, or an INPUT
element of type checkbox
or radiobutton
is currently selected. GET /session/:sessionId/element/:id/enabled Determine if an element is currently enabled. GET /session/:sessionId/element/:id/attribute/:name Get the value of an element’s attribute. GET /session/:sessionId/element/:id/equals/:other Test if two element IDs refer to the same DOM element. GET /session/:sessionId/element/:id/displayed Determine if an element is currently displayed. GET /session/:sessionId/element/:id/location Determine an element’s location on the page. GET /session/:sessionId/element/:id/location_in_view Determine an element’s location on the screen once it has been scrolled into view. GET /session/:sessionId/element/:id/size Determine an element’s size in pixels. GET /session/:sessionId/element/:id/css/:propertyName Query the value of an element’s computed CSS property. GET /session/:sessionId/orientation Get the current browser orientation. POST /session/:sessionId/orientation Set the browser orientation. GET /session/:sessionId/alert_text Gets the text of the currently displayed JavaScript alert()
, confirm()
, or prompt()
dialog. POST /session/:sessionId/alert_text Sends keystrokes to a JavaScript prompt()
dialog. POST /session/:sessionId/accept_alert Accepts the currently displayed alert dialog. POST /session/:sessionId/dismiss_alert Dismisses the currently displayed alert dialog. POST /session/:sessionId/moveto Move the mouse by an offset of the specificed element. POST /session/:sessionId/click Click any mouse button (at the coordinates set by the last moveto command). POST /session/:sessionId/buttondown Click and hold the left mouse button (at the coordinates set by the last moveto command). POST /session/:sessionId/buttonup Releases the mouse button previously held (where the mouse is currently at). POST /session/:sessionId/doubleclick Double-clicks at the current mouse coordinates (set by moveto). POST /session/:sessionId/touch/click Single tap on the touch enabled device. POST /session/:sessionId/touch/down Finger down on the screen. POST /session/:sessionId/touch/up Finger up on the screen. POST session/:sessionId/touch/move Finger move on the screen. POST session/:sessionId/touch/scroll Scroll on the touch screen using finger based motion events. POST session/:sessionId/touch/scroll Scroll on the touch screen using finger based motion events. POST session/:sessionId/touch/doubleclick Double tap on the touch screen using finger motion events. POST session/:sessionId/touch/longclick Long press on the touch screen using finger motion events. POST session/:sessionId/touch/flick Flick on the touch screen using finger motion events. POST session/:sessionId/touch/flick Flick on the touch screen using finger motion events. GET /session/:sessionId/location Get the current geo location. POST /session/:sessionId/location Set the current geo location. GET /session/:sessionId/local_storage Get all keys of the storage. POST /session/:sessionId/local_storage Set the storage item for the given key. DELETE /session/:sessionId/local_storage Clear the storage. GET /session/:sessionId/local_storage/key/:key Get the storage item for the given key. DELETE /session/:sessionId/local_storage/key/:key Remove the storage item for the given key. GET /session/:sessionId/local_storage/size Get the number of items in the storage. GET /session/:sessionId/session_storage Get all keys of the storage. POST /session/:sessionId/session_storage Set the storage item for the given key. DELETE /session/:sessionId/session_storage Clear the storage. GET /session/:sessionId/session_storage/key/:key Get the storage item for the given key. DELETE /session/:sessionId/session_storage/key/:key Remove the storage item for the given key. GET /session/:sessionId/session_storage/size Get the number of items in the storage. POST /session/:sessionId/log Get the log for a given log type. GET /session/:sessionId/log/types Get available log types. GET /session/:sessionId/application_cache/status Get the status of the html5 application cache. Command Detail /status
{object}
An object describing the general status of the server.
desiredCapabilities
- {object}
An object describing the session's desired capabilities.
requiredCapabilities
- {object}
An object describing the session's required capabilities (Optional).
{object}
An object describing the session's capabilities.
SessionNotCreatedException
- If a required capability could not be set.
{Array.<Object>}
A list of the currently active sessions.
:sessionId
- ID of the session to route the command to.
{object}
An object describing the session's capabilities.
:sessionId
- ID of the session to route the command to.
:sessionId
- ID of the session to route the command to.
type
- {string}
The type of operation to set the timeout for. Valid values are: "script" for script timeouts, "implicit" for modifying the implicit wait timeout and "page load" for setting a page load timeout.
ms
- {number}
The amount of time, in milliseconds, that time-limited commands are permitted to run.
/session/:sessionId/execute_async
are permitted to run before they are aborted and a |Timeout| error is returned to the client.
:sessionId
- ID of the session to route the command to.
ms
- {number}
The amount of time, in milliseconds, that time-limited commands are permitted to run.
If this command is never sent, the driver should default to an implicit wait of 0ms.
:sessionId
- ID of the session to route the command to.
ms
- {number}
The amount of time to wait, in milliseconds. This value has a lower bound of 0.
:sessionId
- ID of the session to route the command to.
{string}
The current window handle.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
{Array.<string>}
A list of window handles.
:sessionId
- ID of the session to route the command to.
{string}
The current URL.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
url
- {string}
The URL to navigate to.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
The script
argument defines the script to execute in the form of a function body. The value returned by that function will be returned to the client. The function will be invoked with the provided args
array and the values may be accessed via the arguments
object in the order specified.
Arguments may be any JSON-primitive, array, or JSON object. JSON objects that define a WebElement reference will be converted to the corresponding DOM element. Likewise, any WebElements in the script result will be returned to the client as WebElement JSON objects.
:sessionId
- ID of the session to route the command to.
script
- {string}
The script to execute.
args
- {Array.<*>}
The script arguments.
{*}
The script result.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If one of the script arguments is a WebElement that is not attached to the page's DOM.
JavaScriptError
- If the script throws an Error.
Asynchronous script commands may not span page loads. If an unload
event is fired while waiting for a script result, an error should be returned to the client.
The script
argument defines the script to execute in teh form of a function body. The function will be invoked with the provided args
array and the values may be accessed via the arguments
object in the order specified. The final argument will always be a callback function that must be invoked to signal that the script has finished.
Arguments may be any JSON-primitive, array, or JSON object. JSON objects that define a WebElement reference will be converted to the corresponding DOM element. Likewise, any WebElements in the script result will be returned to the client as WebElement JSON objects.
:sessionId
- ID of the session to route the command to.
script
- {string}
The script to execute.
args
- {Array.<*>}
The script arguments.
{*}
The script result.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If one of the script arguments is a WebElement that is not attached to the page's DOM.
Timeout
- If the script callback is not invoked before the timout expires. Timeouts are controlled by the /session/:sessionId/timeout/async_script
command.
JavaScriptError
- If the script throws an Error or if an unload
event is fired while waiting for the script to finish.
:sessionId
- ID of the session to route the command to.
{string}
The screenshot as a base64 encoded PNG.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
{Array.<string>}
A list of available engines
ImeNotAvailableException
- If the host does not support IME
:sessionId
- ID of the session to route the command to.
{string}
The name of the active IME engine.
ImeNotAvailableException
- If the host does not support IME
:sessionId
- ID of the session to route the command to.
{boolean}
true if IME input is available and currently active, false otherwise
ImeNotAvailableException
- If the host does not support IME
:sessionId
- ID of the session to route the command to.
ImeNotAvailableException
- If the host does not support IME
:sessionId
- ID of the session to route the command to.
engine
- {string}
Name of the engine to activate.
ImeActivationFailedException
- If the engine is not available or if the activation fails for other reasons.
ImeNotAvailableException
- If the host does not support IME
id
is null
, the server
:sessionId
- ID of the session to route the command to.
id
- {string|number|null|WebElement JSON Object}
Identifier for the frame to change focus to.
NoSuchWindow
- If the currently selected window has been closed.
NoSuchFrame
- If the frame specified by id
cannot be found.
:sessionId
- ID of the session to route the command to.
name
attribute.
:sessionId
- ID of the session to route the command to.
name
- {string}
The window to change focus to.
NoSuchWindow
- If the window specified by name
cannot be found.
:sessionId
- ID of the session to route the command to.
NoSuchWindow
- If the currently selected window is already closed
:sessionId
- ID of the session to route the command to.
width
- {number}
The new window width.
height
- {number}
The new window height.
:sessionId
- ID of the session to route the command to.
{width: number, height: number}
The size of the window.
NoSuchWindow
- If the specified window cannot be found.
:sessionId
- ID of the session to route the command to.
x
- {number}
The X coordinate to position the window at, relative to the upper left corner of the screen.
y
- {number}
The Y coordinate to position the window at, relative to the upper left corner of the screen.
NoSuchWindow
- If the specified window cannot be found.
:sessionId
- ID of the session to route the command to.
{x: number, y: number}
The X and Y coordinates for the window, relative to the upper left corner of the screen.
NoSuchWindow
- If the specified window cannot be found.
:sessionId
- ID of the session to route the command to.
NoSuchWindow
- If the specified window cannot be found.
:sessionId
- ID of the session to route the command to.
{Array.<object>}
A list of cookies.
NoSuchWindow
- If the currently selected window has been closed.
"/"
. Likewise, if the domain is omitted, it should default to the current page's domain.
:sessionId
- ID of the session to route the command to.
cookie
- {object}
A JSON object defining the cookie to add.
:sessionId
- ID of the session to route the command to.
InvalidCookieDomain
- If the cookie's domain
is not visible from the current page.
NoSuchWindow
- If the currently selected window has been closed.
UnableToSetCookie
- If attempting to set a cookie on a page that does not support cookies (e.g. pages with mime-type text/plain
).
:sessionId
- ID of the session to route the command to.
:name
- The name of the cookie to delete.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
{string}
The current page source.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
{string}
The current page title.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
using
- {string}
The locator strategy to use.
value
- {string}
The The search target.
{ELEMENT:string}
A WebElement JSON object for the located element.
NoSuchWindow
- If the currently selected window has been closed.
NoSuchElement
- If the element cannot be found.
XPathLookupError
- If using XPath and the input expression is invalid.
:sessionId
- ID of the session to route the command to.
using
- {string}
The locator strategy to use.
value
- {string}
The The search target.
{Array.<{ELEMENT:string}>}
A list of WebElement JSON objects for the located elements.
NoSuchWindow
- If the currently selected window has been closed.
XPathLookupError
- If using XPath and the input expression is invalid.
:sessionId
- ID of the session to route the command to.
{ELEMENT:string}
A WebElement JSON object for the active element.
NoSuchWindow
- If the currently selected window has been closed.
Note: This command is reserved for future use; its return type is currently undefined.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
using
- {string}
The locator strategy to use.
value
- {string}
The The search target.
{ELEMENT:string}
A WebElement JSON object for the located element.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
NoSuchElement
- If the element cannot be found.
XPathLookupError
- If using XPath and the input expression is invalid.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
using
- {string}
The locator strategy to use.
value
- {string}
The The search target.
{Array.<{ELEMENT:string}>}
A list of WebElement JSON objects for the located elements.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
XPathLookupError
- If using XPath and the input expression is invalid.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
ElementNotVisible
- If the referenced element is not visible on the page (either is hidden by CSS, has 0-width, or has 0-height)
FORM
element. The submit command may also be applied to any element that is a descendant of a FORM
element.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
Any UTF-8 character may be specified, however, if the server does not support native key events, it should simulate key strokes for a standard US keyboard layout. The Unicode Private Use Area code points, 0xE000-0xF8FF, are used to represent pressable, non-text keys (see table below).
Key Code NULL U+E000 Cancel U+E001 Help U+E002 Back space U+E003 Tab U+E004 Clear U+E005 Return1 U+E006 Enter1 U+E007 Shift U+E008 Control U+E009 Alt U+E00A Pause U+E00B Escape U+E00C Key Code Space U+E00D Pageup U+E00E Pagedown U+E00F End U+E010 Home U+E011 Left arrow U+E012 Up arrow U+E013 Right arrow U+E014 Down arrow U+E015 Insert U+E016 Delete U+E017 Semicolon U+E018 Equals U+E019 Key Code Numpad 0 U+E01A Numpad 1 U+E01B Numpad 2 U+E01C Numpad 3 U+E01D Numpad 4 U+E01E Numpad 5 U+E01F Numpad 6 U+E020 Numpad 7 U+E021 Numpad 8 U+E022 Numpad 9 U+E023 Key Code Multiply U+E024 Add U+E025 Separator U+E026 Subtract U+E027 Decimal U+E028 Divide U+E029 Key Code F1 U+E031 F2 U+E032 F3 U+E033 F4 U+E034 F5 U+E035 F6 U+E036 F7 U+E037 F8 U+E038 F9 U+E039 F10 U+E03A F11 U+E03B F12 U+E03C Command/Meta U+E03D 1 The return key is not the same as the enter key.The server must process the key sequence as follows:
NULL
(U+E000) key is encountered.NULL
key. Subsequently, all depressed modifier keys must be released (with corresponding keyup events) at the end of the sequence.:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
value
- {Array.<string>}
The sequence of keys to type. An array must be provided. The server should flatten the array items to a single string to be typed.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
ElementNotVisible
- If the referenced element is not visible on the page (either is hidden by CSS, has 0-width, or has 0-height)
:sessionId
- ID of the session to route the command to.
value
- {Array.<string>}
The keys sequence to be sent. The sequence is defined in thesend keys command.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{string}
The element's tag name, as a lowercase string.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
TEXTAREA
or text INPUT
element's value.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
ElementNotVisible
- If the referenced element is not visible on the page (either is hidden by CSS, has 0-width, or has 0-height)
InvalidElementState
- If the referenced element is disabled.
OPTION
element, or an INPUT
element of type checkbox
or radiobutton
is currently selected.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{boolean}
Whether the element is selected.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{boolean}
Whether the element is enabled.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{string|null}
The value of the attribute, or null if it is not set on the element.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
:other
- ID of the element to compare against.
{boolean}
Whether the two IDs refer to the same element.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If either the element refered to by :id
or :other
is no longer attached to the page's DOM.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{boolean}
Whether the element is displayed.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
(0, 0)
refers to the upper-left corner of the page. The element's coordinates are returned as a JSON object with x
and y
properties.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{x:number, y:number}
The X and Y coordinates for the element on the page.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
Note: This is considered an internal command and should only be used to determine an element's
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{x:number, y:number}
The X and Y coordinates for the element.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
width
and height
properties.
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{width:number, height:number}
The width and height of the element, in pixels.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
background-color
instead of backgroundColor
).
:sessionId
- ID of the session to route the command to.
:id
- ID of the element to route the command to.
{string}
The value of the specified CSS property.
NoSuchWindow
- If the currently selected window has been closed.
StaleElementReference
- If the element referenced by :id
is no longer attached to the page's DOM.
{LANDSCAPE|PORTRAIT}
.
:sessionId
- ID of the session to route the command to.
{string}
The current browser orientation corresponding to a value defined in ScreenOrientation: {LANDSCAPE|PORTRAIT}
.
NoSuchWindow
- If the currently selected window has been closed.
{LANDSCAPE|PORTRAIT}
.
:sessionId
- ID of the session to route the command to.
orientation
- {string}
The new browser orientation as defined in ScreenOrientation: {LANDSCAPE|PORTRAIT}
.
NoSuchWindow
- If the currently selected window has been closed.
alert()
, confirm()
, or prompt()
dialog.
:sessionId
- ID of the session to route the command to.
{string}
The text of the currently displayed alert.
NoAlertPresent
- If there is no alert displayed.
prompt()
dialog.
:sessionId
- ID of the session to route the command to.
text
- {string}
Keystrokes to send to the prompt()
dialog.
NoAlertPresent
- If there is no alert displayed.
:sessionId
- ID of the session to route the command to.
NoAlertPresent
- If there is no alert displayed.
confirm()
and prompt()
dialogs, this is equivalent to clicking the 'Cancel' button. For alert()
dialogs, this is equivalent to clicking the 'OK' button.
:sessionId
- ID of the session to route the command to.
NoAlertPresent
- If there is no alert displayed.
:sessionId
- ID of the session to route the command to.
element
- {string}
Opaque ID assigned to the element to move to, as described in the WebElement JSON Object. If not specified or is null, the offset is relative to current position of the mouse.
xoffset
- {number}
X offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element.
yoffset
- {number}
Y offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element.
:sessionId
- ID of the session to route the command to.
button
- {number}
Which button, enum: {LEFT = 0, MIDDLE = 1 , RIGHT = 2}
. Defaults to the left mouse button if not specified.
:sessionId
- ID of the session to route the command to.
button
- {number}
Which button, enum: {LEFT = 0, MIDDLE = 1 , RIGHT = 2}
. Defaults to the left mouse button if not specified.
:sessionId
- ID of the session to route the command to.
button
- {number}
Which button, enum: {LEFT = 0, MIDDLE = 1 , RIGHT = 2}
. Defaults to the left mouse button if not specified.
:sessionId
- ID of the session to route the command to.
:sessionId
- ID of the session to route the command to.
element
- {string}
ID of the element to single tap on.
:sessionId
- ID of the session to route the command to.
x
- {number}
X coordinate on the screen.
y
- {number}
Y coordinate on the screen.
:sessionId
- ID of the session to route the command to.
x
- {number}
X coordinate on the screen.
y
- {number}
Y coordinate on the screen.
:sessionId
- ID of the session to route the command to.
x
- {number}
X coordinate on the screen.
y
- {number}
Y coordinate on the screen.
:sessionId
- ID of the session to route the command to.
element
- {string}
ID of the element where the scroll starts.
xoffset
- {number}
The x offset in pixels to scroll by.
yoffset
- {number}
The y offset in pixels to scroll by.
:sessionId
- ID of the session to route the command to.
xoffset
- {number}
The x offset in pixels to scrollby.
yoffset
- {number}
The y offset in pixels to scrollby.
:sessionId
- ID of the session to route the command to.
element
- {string}
ID of the element to double tap on.
:sessionId
- ID of the session to route the command to.
element
- {string}
ID of the element to long press on.
:sessionId
- ID of the session to route the command to.
element
- {string}
ID of the element where the flick starts.
xoffset
- {number}
The x offset in pixels to flick by.
yoffset
- {number}
The y offset in pixels to flick by.
speed
- {number}
The speed in pixels per seconds.
:sessionId
- ID of the session to route the command to.
xspeed
- {number}
The x speed in pixels per second.
yspeed
- {number}
The y speed in pixels per second.
:sessionId
- ID of the session to route the command to.
{latitude: number, longitude: number, altitude: number}
The current geo location.
:sessionId
- ID of the session to route the command to.
location
- {latitude: number, longitude: number, altitude: number}
The new location.
:sessionId
- ID of the session to route the command to.
{Array.<string>}
The list of keys.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
key
- {string}
The key to set.
value
- {string}
The value to set.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
:key
- The key to get.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
:key
- The key to remove.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
{number}
The number of items in the storage.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
{Array.<string>}
The list of keys.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
key
- {string}
The key to set.
value
- {string}
The value to set.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
:key
- The key to get.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
:key
- The key to remove.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
{number}
The number of items in the storage.
NoSuchWindow
- If the currently selected window has been closed.
:sessionId
- ID of the session to route the command to.
type
- {string}
The log type. This must be provided.
{Array.<object>}
The list of log entries.
:sessionId
- ID of the session to route the command to.
{Array.<string>}
The list of available log types.
:sessionId
- ID of the session to route the command to.
{number}
Status code for application cache: {UNCACHED = 0, IDLE = 1, CHECKING = 2, DOWNLOADING = 3, UPDATE_READY = 4, OBSOLETE = 5}
Learn more or view the full list of sponsors.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4