Copyright © 2025World Wide Web Consortium.W3C®liability,trademark andpermissive document license rules apply.
WebDriver is a remote control interfacethat enables introspection and control of user agents.It provides a platform- and language-neutral wire protocolas a way for out-of-process programsto remotely instruct the behavior of web browsers.
Provided is a set of interfacesto discover and manipulate DOM elements in web documentsand to control the behavior of a user agent.It is primarily intended to allow web authors to write teststhat automate a user agent from a separate controlling process,but may also be used in such a way as to allow in-browser scriptsto control a — possibly separate — browser.
This section describes the status of this document at the time of its publication. A list of currentW3C publications and the latest revision of this technical report can be found in theW3C standards and drafts index.
This document was published by theBrowser Testing and Tools Working Group as an Editor's Draft.
Publication as an Editor's Draft does not imply endorsement byW3C and its Members.
This is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to cite this document as other than a work in progress.
This document was produced by a group operating under theW3C Patent Policy.W3C maintains apublic list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent that the individual believes containsEssential Claim(s) must disclose the information in accordance withsection 6 of theW3C Patent Policy.
This document is governed by the18 August 2025W3C Process Document.
This section is non-normative.
The WebDriver standard attempts to follow a number of design goals:
This specification is derived from the popularSelenium WebDriver browser automation framework.Selenium is a long-lived project,and due to its age and breadth of useit has a wide range of expected functionality.This specification uses these expectations to inform its design.Where improvements or clarifications have been made,they have been made with care to allow existing users of Selenium WebDriverto avoid unexpected breakages.
The largest intended group of users of this specificationare software developers and testerswriting automated tests and other tooling,such as monitoring or load testing, that relies on automating a browser.As such, care has been taken to provide commandsthat simplify common tasks such astyping intoandclicking elements.
WebDriver provides a mechanism for others to define extensions to the protocolfor the purposes of automating functionality that cannot be implemented entirelyinECMAScript. This allows otherweb standards to support the automation of new platform features. It alsoallows vendors to expose functionality that is specific to their browser.
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
Conformance requirements phrased as algorithmsor specific steps may be implemented in any manner,so long as the end result is equivalent.Algorithms in this document are typically written with readability,rather than performance, in mind.
In equations, all numbers are integers,addition is represented by “+”,subtraction by “−”,division by “÷”,and bitwise OR by “|”.The characters “(” and “)” are used to provide logical grouping in these contexts.
The mathematical functionmin(value,value[,value])returns the smallest item of two or more values.Conversely, the functionmax(value,value[,value])returns the largest item of two or more values.
The mathematical functionfloor(value)produces the largest integer, closest to positive infinity,that is not larger thanvalue.
AUniversally Unique Identifier (UUID)is a 128 bits long URN that requires no central registration process.Generating a UUID meansCreating a UUID From Truly Random or Pseudo-Random Numbers,and converting it to the string representation.[RFC4122]
TheUnix Epochis a value that approximates the number of secondsthat have elapsed since the Epoch,as described by The Open Group Base Specifications Issue 7section 4.15 (IEEE Std 1003.1).
Aninteger is aNumber that is unchangedunder theToInteger operation.
Theinitial value of an ECMAScript propertyis the value defined by the platform for that property,i.e. the value it would have in the absence of any shadowing by content script.
Thebrowser chrome is a non-normative termto refer to the representation through which the userinteracts with the user agent itself,as distinct from the accessed web content.Examples ofbrowser chrome elementsinclude, but are not limited to,toolbars (such as the bookmark toolbar),menus (such as the file or context menu),buttons (such as the back and forward buttons),door hangers (such as security and certificate indicators),and decorations (such as operating system widget borders).
This feature is in all major engines.
| Chrome | 63+ |
| Chrome Android | ? |
| Edge | 12+ |
| Edge Mobile | ? |
| Firefox | 60+ |
| Firefox Android | ? |
| Opera | ? |
| Opera Android | ? |
| Safari | 10.1+ |
| Safari iOS | ? |
| Samsung Internet | ? |
| WebView Android | ? |
Thewebdriver-active flagis set to true when the user agent is under remote control.It is initially false.
WebIDLinterface mixinNavigatorAutomationInformation { readonly attributebooleanwebdriver;};Navigator includesNavigatorAutomationInformation;TheNavigatorAutomationInformation interfaceshould not be exposed onWorkerNavigator.
Returns true ifwebdriver-active flag is set, false otherwise.
For web authors (non-normative):
navigator.webdriverDefines a standard way for co-operating user agentsto inform the document that it is controlled by WebDriver,for example so that alternate code paths can be triggered during automation.
It is acknowledged that this is complementary to the Evil Bit [RFC3514].
The WebDriver protocol consists of communication between:
The local end represents the client side of the protocol, which is usually in the form of language-specific libraries providing an API on top of the WebDriverprotocol. This specification does not place any restrictions on the details of those libraries above the level of the wire protocol.
Forremote ends the standard defines two broad conformance classes, known asnode types:
All remote endnode types must be black-box indistinguishable from aremote end, from the point of view oflocal end, and so are bound by the requirements on aremote end in terms of the wire protocol.
Thereadiness state of aremote end indicateswhether it is free to accept new connections. It must be false if theimplementation is anendpoint node and the list ofactiveHTTP sessions is not empty, or otherwise if theremote end is known tobe in a state in which attempting to createnew sessions wouldfail. In all other cases it must be true.
If theintermediary node is a multiplexer that manages multipleendpoint nodes, this might indicate its ability to purvey moresessions, for example if it has hit its maximum capacity.
WebDriverremote ends must provide anHTTP compliant wire protocol where theendpoints map to differentcommands.
As this standard only defines theremote end protocol, it puts no demands to howlocal ends should be implemented.Local ends are only expected to be compatible to the extent that they can speak theremote end's protocol; no requirements are made upon their exposed user-facing API.
Various parts of this specification are written in terms of step-by-step algorithms. The details of these algorithms do not have any normative significance; implementations are free to adopt any implementation strategy that produces equivalent output to the specification. In particular, algorithms in this document are optimized for readability rather than performance.
Where algorithms that return values are fallible, they are written in terms of returning eithersuccess orerror. Asuccess value has an associateddata field which encapsulates the value returned, whereas anerror value has an associatederror code.
When calling a fallible algorithm, the construct “Letresult be the result oftrying to callalgorithm” is equivalent to
Lettemp be the result of callingalgorithm.
Iftemp is anerror returntemp, otherwise letresult betemp'sdata field.
The result ofgetting a property withname fromobject is defined as being the same as the result of callingObject.[[GetOwnProperty]](name) onobject.
The result ofgetting a property with default with argumentsname anddefault fromobject is defined as being the same as the result of callingObject.[[GetOwnProperty]](name) onobject if that results in a value other thanundefined anddefault otherwise.
Setting a property with argumentsname andvalue onobject is defined as being the same as callingObject.[[Put]](name,value) onobject.
The result ofJSON serialization withobject of type JSONObject is defined as the result of callingstringify(object).
The result ofJSON deserialization withtext is defined as the result of callingparse(text).
The WebDriver protocol is organized intocommands.EachHTTP request with a method and template defined in this specificationrepresents a singlecommand,and therefore each command produces a singleHTTP response.
In response to acommand,aremote end will run a series of actionsknown asremote end steps.These provide the sequences of actions that aremote end takeswhen it receives a particularcommand.
Theremote end is an HTTP server reading requests from the client and writing responses, typically over a TCP socket. For the purposes of this specification we model the data transmission between a particularlocal end andremote end with aconnection to which theremote end maywrite bytes andread bytes. However the exact details of how thisconnection works and how it is established are out of scope.
After aconnection is established, theremote end must runthe following steps:
While theconnection is not closed:
Read bytes from theconnection until a completeHTTP request can be constructed from the data. Letrequest be arequest constructed from the received data, according to the requirements of [RFC7230]. If it is not possible to construct a completeHTTP request, theremote end must either close theconnection, return an HTTP response with status code 500, or return anerror witherror codeunknown error.
Letrequest match be the result of the algorithm tomatch a request withrequest'smethod andURL as arguments.
Ifrequest match is of typeerror,send an error withrequest match'serror code andcontinue.
Otherwise, letcommand andURL variables berequest match's data.
Letsession be null.
IfURL variablescontains "session id":
This condition is intended to exclude theNew Session andStatuscommands and anyextension commands which do not operate on a particularsession.
Letsession id beURL variables["session id"].
For eachactive session in the list ofactive sessions:
Ifactive session'ssession ID is equal tosession id, then letsession beactive session, and break.
If thesession isnullsend an error witherror codeinvalid session id, thencontinue.
Enqueue a task onremote end'srequest queue to run the following steps:
Letparameters benull.
Ifrequest'smethod is POST:
Letparse result be the result ofparsing as JSON withrequest'sbody as the argument. If this process throws an exception, return anerror witherror codeinvalid argument and jump back to step 1 in this overall algorithm.
Ifparse result is not anObject,send an error witherror codeinvalid argument and jump back to step 1 in this overall algorithm.
Otherwise, letparameters beparse result.
Letnavigate result be the result ofwait for navigation to complete withsession.
Ifnavigate result is anerror,send an error witherror code equal tonavigate result'serror code and return.
Letresponse result be the return value obtained by running theremote end steps forcommand withsession,URL variables, andparameters.
Ifresponse result is anerror,send an error witherror code equal toresponse result'serror code and return.
Assert:response result is asuccess.
Letresponse data beresponse result's data.
Send a response with status 200 andresponse data.
When required tosend an error, witherror code and an optionalerror data dictionary, aremote end must run the following steps:
Letstatus andname be theerror response data forerror code.
Letmessage be an implementation-defined string containing a human-readable description of the reason for the error.
Letstacktrace be an implementation-defined string containing a stack trace report of the active stack frames at the time when the error occurred.
Letbody be a new JSONObject initialized with the following properties:
error"message"stacktrace"If theerror data dictionary contains any entries, set the "data" field onbody to a new JSONObject populated with the dictionary.
Send a response withstatus andbody as arguments.
When required tosend a response, with argumentsstatus anddata, aremote end must run the following steps:
Letresponse be a newresponse.
Setresponse'sHTTP status tostatus, andstatus message to the string corresponding to the description ofstatus in thestatus code registry.
Set theresponse'sheader withname andvalue with the following values:
Content-Typeapplication/json; charset=utf-8"Cache-Controlno-cache"Letresponse'sbody be theUTF-8 encodedJSON serialization of a JSONObject with a key "value" set todata.
Letresponse bytes be the byte sequence resulting from serializingresponse according to the rules in [RFC7230].
Writeresponse bytes to theconnection.
Request routing is the process of going from anHTTP request to theseries of steps needed to implement thecommand represented by that request.
Aremote end has an associatedURL prefix, which is used as a prefix on all WebDriver-defined URLs on thatremote end. This must either beundefined or apath-absolute URL.
For example aremote end wishing to run alongside other services onexample.com might set itsURL prefix to/wd so that anew sessioncommand would be invoked by sending a POST request to/wd/session, rather than/session.
In order tomatch a request given amethod andURL, the following steps must be taken:
Letendpoints be a list containing each row in thetable of endpoints.
Remove each entry fromendpoints for which the concatenation of theURL prefix and the entry'sURI template does not have a valid expansion equal toURL'spath.
If there are no entries inendpoints, returnerror witherror codeunknown command.
Remove each entry inendpoints for which themethod column is not equal tomethod.
If there are no entries inendpoints, returnerror witherror codeunknown method.
There is now exactly one entry inendpoints; letentry be this entry.
LetURI template be the concatenation ofURL prefix withentry'sURI template.
Letcommand beentry'scommand.
LetURL variables be amap with oneentry for each variable defined inURI template, with the entry name equal to the template variable name, and the entry value being the variable value required to expand theURI template to matchURL'spath.
Returnsuccess with datacommand andURL variables.
The followingtable of endpoints lists themethod andURI template for eachendpoint nodecommand.Extension commands are implicitly appended to this table.
| Method | URI Template | Command |
|---|---|---|
| POST | /session | New Session |
| DELETE | /session/{session id} | Delete Session |
| GET | /status | Status |
| GET | /session/{session id}/timeouts | Get Timeouts |
| POST | /session/{session id}/timeouts | Set Timeouts |
| POST | /session/{session id}/url | Navigate To |
| GET | /session/{session id}/url | Get Current URL |
| POST | /session/{session id}/back | Back |
| POST | /session/{session id}/forward | Forward |
| POST | /session/{session id}/refresh | Refresh |
| GET | /session/{session id}/title | Get Title |
| GET | /session/{session id}/window | Get Window Handle |
| DELETE | /session/{session id}/window | Close Window |
| POST | /session/{session id}/window | Switch To Window |
| GET | /session/{session id}/window/handles | Get Window Handles |
| POST | /session/{session id}/window/new | New Window |
| POST | /session/{session id}/frame | Switch To Frame |
| POST | /session/{session id}/frame/parent | Switch To Parent Frame |
| GET | /session/{session id}/window/rect | Get Window Rect |
| POST | /session/{session id}/window/rect | Set Window Rect |
| POST | /session/{session id}/window/maximize | Maximize Window |
| POST | /session/{session id}/window/minimize | Minimize Window |
| POST | /session/{session id}/window/fullscreen | Fullscreen Window |
| GET | /session/{session id}/element/active | Get Active Element |
| GET | /session/{session id}/element/{element id}/shadow | Get Element Shadow Root |
| POST | /session/{session id}/element | Find Element |
| POST | /session/{session id}/elements | Find Elements |
| POST | /session/{session id}/element/{element id}/element | Find Element From Element |
| POST | /session/{session id}/element/{element id}/elements | Find Elements From Element |
| POST | /session/{session id}/shadow/{shadow id}/element | Find Element From Shadow Root |
| POST | /session/{session id}/shadow/{shadow id}/elements | Find Elements From Shadow Root |
| GET | /session/{session id}/element/{element id}/selected | Is Element Selected |
| GET | /session/{session id}/element/{element id}/attribute/{name} | Get Element Attribute |
| GET | /session/{session id}/element/{element id}/property/{name} | Get Element Property |
| GET | /session/{session id}/element/{element id}/css/{property name} | Get Element CSS Value |
| GET | /session/{session id}/element/{element id}/text | Get Element Text |
| GET | /session/{session id}/element/{element id}/name | Get Element Tag Name |
| GET | /session/{session id}/element/{element id}/rect | Get Element Rect |
| GET | /session/{session id}/element/{element id}/enabled | Is Element Enabled |
| GET | /session/{session id}/element/{element id}/computedrole | Get Computed Role |
| GET | /session/{session id}/element/{element id}/computedlabel | Get Computed Label |
| POST | /session/{session id}/element/{element id}/click | Element Click |
| POST | /session/{session id}/element/{element id}/clear | Element Clear |
| POST | /session/{session id}/element/{element id}/value | Element Send Keys |
| GET | /session/{session id}/source | Get Page Source |
| POST | /session/{session id}/execute/sync | Execute Script |
| POST | /session/{session id}/execute/async | Execute Async Script |
| GET | /session/{session id}/cookie | Get All Cookies |
| GET | /session/{session id}/cookie/{name} | Get Named Cookie |
| POST | /session/{session id}/cookie | Add Cookie |
| DELETE | /session/{session id}/cookie/{name} | Delete Cookie |
| DELETE | /session/{session id}/cookie | Delete All Cookies |
| POST | /session/{session id}/actions | Perform Actions |
| DELETE | /session/{session id}/actions | Release Actions |
| POST | /session/{session id}/alert/dismiss | Dismiss Alert |
| POST | /session/{session id}/alert/accept | Accept Alert |
| GET | /session/{session id}/alert/text | Get Alert Text |
| POST | /session/{session id}/alert/text | Send Alert Text |
| GET | /session/{session id}/screenshot | Take Screenshot |
| GET | /session/{session id}/element/{element id}/screenshot | Take Element Screenshot |
| POST | /session/{session id}/print | Print Page |
Errors are represented in the WebDriver protocol by anHTTP response with anHTTP status in the 4xx or 5xx range, and a JSON body containing details of theerror. The body is a JSONObject and has a field named "value" whose value is an object bearing three, and sometimes four, fields:
error", containing a string indicating theerror code.message", containing an implementation-defined string with a human readable description of the kind of error that occurred.stacktrace", containing an implementation-defined string with a stack trace report of the active stack frames at the time when the error occurred.data", which is a JSONObject with additionalerror data helpful in diagnosing the error.AGET request to/session/1234/url, where1234 is not thesession id of asession would return anHTTP response with the status 404 and a body of the form:
{"value":{"error":"invalid session id","message":"No active session with ID 1234","stacktrace":""}}Certain commands may also annotateerrors with additionalerror data. Notably, this is the case for commands which invoke theuser prompt handler, where theuser prompt message may be included in a "text" field:
{"value": {"error":"unexpected alert open","message":"","stacktrace":"","data": {"text":"Message from window.alert"}}}The following table lists eacherror code, its associatedHTTP status, JSONerror code, and a non-normative description of the error. Theerror response data for a particularerror code is the values of theHTTP Status andJSON Error Code columns for the row corresponding to thaterror code.
| Error Code | HTTP Status | JSON Error Code | Description |
|---|---|---|---|
| element click intercepted | 400 | element click intercepted | TheElement Clickcommand could not be completed because theelement receiving the events isobscuring the element that was requested clicked. |
| element not interactable | 400 | element not interactable | Acommand could not be completed because the element is notpointer- orkeyboardinteractable. |
| insecure certificate | 400 | insecure certificate | Navigation caused the user agent to hit a certificate warning, which is usually the result of an expired or invalid TLS certificate. |
| invalid argument | 400 | invalid argument | The arguments passed to acommand are either invalid or malformed. |
| invalid cookie domain | 400 | invalid cookie domain | An illegal attempt was made to set a cookie under a different domain than the current page. |
| invalid element state | 400 | invalid element state | Acommand could not be completed because the element is in an invalid state, e.g. attempting toclear an element that isn't botheditable andresettable. |
| invalid selector | 400 | invalid selector | Argument was an invalid selector. |
| invalid session id | 404 | invalid session id | Occurs if the givensession id is not in the list ofactive sessions, meaning thesession either does not exist or that it's not active. |
| javascript error | 500 | javascript error | An error occurred while executing JavaScript supplied by the user. |
| move target out of bounds | 500 | move target out of bounds | The target for mouse interaction is not in the browser's viewport and cannot be brought into that viewport. |
| no such alert | 404 | no such alert | An attempt was made to operate on a modal dialog when one was not open. |
| no such cookie | 404 | no such cookie | No cookie matching the given path name was found amongst theassociated cookies ofsession'scurrent browsing context'sactive document. |
| no such element | 404 | no such element | An element could not be located on the page using the given search parameters. |
| no such frame | 404 | no such frame | Acommand to switch to a frame could not be satisfied because the frame could not be found. |
| no such window | 404 | no such window | Acommand to switch to a window could not be satisfied because the window could not be found. |
| no such shadow root | 404 | no such shadow root | The element does not have a shadow root. |
| script timeout error | 500 | script timeout | A script did not complete before its timeout expired. |
| session not created | 500 | session not created | A newsession could not be created. |
| stale element reference | 404 | stale element reference | Acommand failed because the referencedelement is no longer attached to the DOM. |
| detached shadow root | 404 | detached shadow root | Acommand failed because the referencedshadow root is no longer attached to the DOM. |
| timeout | 500 | timeout | An operation did not complete before its timeout expired. |
| unable to set cookie | 500 | unable to set cookie | Acommand to set a cookie's value could not be satisfied. |
| unable to capture screen | 500 | unable to capture screen | A screen capture was made impossible. |
| unexpected alert open | 500 | unexpected alert open | A modal dialog was open, blocking this operation. |
| unknown command | 404 | unknown command | Acommand could not be executed because theremote end is not aware of it. |
| unknown error | 500 | unknown error | An unknown error occurred in theremote end while processing thecommand. |
| unknown method | 405 | unknown method | The requestedcommand matched a known URL but did not match any method for that URL. |
| unsupported operation | 500 | unsupported operation | Indicates that acommand that should have executed properly cannot be supported for some reason. |
Anerror data dictionary is a mapping of string keys to JSON serializable values that can optionally be included witherror objects.
Using the terminology defined in this section, others may define additional commands that seamlessly integrate with the standard protocol. This allows vendors to expose functionality that is specific to their user agent, and it also allows other web standards to define commands for automating new platform features.
Commands defined in this way are calledextension commands and behave no differently than othercommands; each has a dedicated HTTP endpoint and a set ofremote end steps.
Eachextension command has an associatedextension command URI Template that is aURI Template string, and which should bear some resemblance to what the command performs. This value, along with the HTTP method andextension command, is added to thetable of endpoints and thus follows the same rules forrequest routing as that of other built-incommands.
In order to avoid potential resource conflicts with other implementations, vendor-specificextension command URI Templates must begin with one or more path segments which uniquely identifies the vendor and UA. It is suggested that vendors use their vendor prefixes without additional characters as outlined in [CSS21], notably insection 4.1.2.2 onvendor keywords, as the name for this path element, and include a vendor-chosen UA identifier.
This might lead to a URL of the form/session/5d376174-36f0-11e5-9b9a-6bdf200a3f7f/ms/edge/context, wheresession/{session id} associates the request with the specified session,ms/edge identifies the command as specific to the Edge browser distributed by Microsoft, andcontext describes the functionality that, in the context of Edge, allows alocal end to switch between browser-specific contexts. Requesting this URL will call theextension command'sremote end steps.
Other specifications may defineadditional WebDriver capabilities. Each definedcapability must have acapability name whichis a string not containing a ":" (colon) character,anadditional capability deserializationalgorithm which is a set of steps taking a singleargumentvalue which has a JSON type, returningeithersuccess wrapping the deserialized capability valueorerror.
Anadditional WebDriver capability may also defineamatched capability serialization algorithm,which is a set of steps used to determine if a capability is matchedby the current implementation and provide any computed value to returnto the user. This set of steps takes a singleargumentvalue, which is the output of thecorrespondingadditional capability deserialization algorithm,and returns eithernull to indicate the capabilityis not matched, or a non-null JSON-serializable value if thecapability is matched.
Other specifications may also defineWebDrivernew session algorithms, which are called just after a newsession is created, and before thenew session response is sentto theremote end. These algorithms are calledwithsession representing the WebDriver session that willbe established, andcapabilities, the capabilities object that will be returnedto theremote end. It is permitted for such an algorithm tomodify any entry in the capabilities object with a name that's anadditional WebDriver capability defined by the samespecification.
Remote ends may also introduceextension capabilities that are extracapabilities used to provide configuration or fulfill other vendor-specific needs. Extension capabilities' key must contain a ":" (colon) character, denoting an implementation specific namespace. The value can be arbitrary JSON types.
As withextension commands, it is suggested that the key used to denote theextension capability namespace is based on thevendor keywords listed in [CSS21] and precedes the first ":" character in the string.
Extension capabilities are typically used to provide UA orintermediary node specific configuration that is not handled by thetable of standard capabilities.
An examplenew session request body might look like this:
{"capabilities":{"alwaysMatch":{// browser specific configuration"<prefix>:browserOptions":{"binary":"/usr/bin/browser-binary","args":["--start-page=https://example.com"],}}}}WebDrivercapabilities are used to communicate the features supported by a given implementation. Thelocal end may use capabilities to define which features it requires theremote end to satisfy when creating anew session. Likewise, theremote end uses capabilities to describe the full feature set for asession.
The followingtable of standard capabilities enumerates the capabilities each implementation must support. An implementation may define additionalextension capabilities.
As an example, Mozilla could elect to hide new features behind capabilitieswith a "moz:" prefix:
{"browserName":"firefox","browserVersion":"1234","moz:experimental-webdriver":true}| Capability | Key | Value Type | Description |
|---|---|---|---|
| Browser name | "browserName" | string | Identifies the user agent. |
| Browser version | "browserVersion" | string | Identifies the version of the user agent. |
| Platform name | "platformName" | string | Identifies the operating system of theendpoint node. |
| Accept insecure TLS certificates | "acceptInsecureCerts" | boolean | Indicates whether untrusted and self-signed TLS certificates are implicitly trusted onnavigation for the duration of thesession. |
| Page load strategy | "pageLoadStrategy" | string | Defines thesession'spage load strategy. |
| Proxy configuration | "proxy" | JSONObject | Defines thesession'sproxy configuration. |
| Window dimensioning/positioning | "setWindowRect" | boolean | Indicates whether the remote end supports all of theresizing and repositioningcommands. |
| Session timeouts | "timeouts" | JSONObject | Describes thetimeouts imposed on certain session operations. |
| Strict file interactability | "strictFileInteractability" | boolean | Defines thesession'sstrict file interactability. |
| Unhandled prompt behavior | "unhandledPromptBehavior" | string | Describes thesession'suser prompt handler. Defaults to "dismiss and notify". |
| User Agent | "userAgent" | string | Identifies thedefault User-Agent value of theendpoint node. |
Theproxy configuration capability is a JSONObject nested within the primarycapabilities. Implementations may define additional proxy configuration options, but they must not alter the semantics of those listed below.
| Key | Value Type | Description | Valid values |
|---|---|---|---|
proxyType | string | Indicates the type of proxy configuration. | "pac", "direct", "autodetect", "system", or "manual". |
proxyAutoconfigUrl | string | Defines the URL for aproxy autoconfiguration file if is equal to "pac". | AnyURL. |
httpProxy | string | Defines the proxyhost for HTTP traffic when the is "manual". | Ahost and optional port for scheme "http". |
noProxy | array | Lists the address for which the proxy should be bypassed when the is "manual". | AList containing any number ofStrings. |
sslProxy | string | Defines the proxyhost for encrypted TLS traffic when the is "manual". | Ahost and optional port for scheme "https". |
socksProxy | string | Defines the proxyhost for aSOCKS proxy when the is "manual". | Ahost and optional port with anundefined scheme. |
socksVersion | number | Defines theSOCKS proxy version when the is "manual". | Anyinteger between 0 and 255 inclusive. |
Ahost and optional port for ascheme is defined as being a validhost, optionally followed by a colon and a validport. Thehost mayinclude credentials. If the port is omitted andscheme has adefault port, this is the implied port. Otherwise, the port is left undefined.
A of "proxyTypedirect" indicates that the browser should not use a proxy at all.
A of "proxyTypesystem" indicates that the browser should use the various proxies configured for the underlying Operating System.
A of "proxyTypeautodetect" indicates that the proxy to use should be detected in an implementation-specific way.
Theremote end steps todeserialize as a proxy argumentparameter are:
Ifparameter is not a JSONObject return anerror witherror codeinvalid argument.
Letproxy be a new, emptyproxy configuration object.
For each enumerableown property inparameter run the following substeps:
Letkey be the name of the property.
Letvalue be the result ofgetting a property namedname fromparameter.
If there is no matchingkey forkey in theproxy configuration table return anerror witherror codeinvalid argument.
Ifvalue is not one of thevalid values for thatkey, return anerror witherror codeinvalid argument.
Set a propertykey tovalue onproxy.
Ifproxy does not have anown property for "proxyType" return anerror witherror codeinvalid argument.
If the result ofgetting a property named "proxyType" fromproxy equals "pac", andproxy does not have anown property for "proxyAutoconfigUrl" return anerror witherror codeinvalid argument.
Ifproxy has anown property for "socksProxy" and does not have anown property for "socksVersion" return anerror witherror codeinvalid argument.
Returnsuccess with dataproxy.
Aproxy configuration object is a JSONObject where each of itsown properties matching keys in theproxy configuration meets the validity criteria for that key.
Toprocess capabilities givenparameters, andsession configuration flagsflags, theendpoint node must take the following steps:
Letcapabilities request be the result ofgetting the property "capabilities" fromparameters.
Ifcapabilities request is not a JSONObject, returnerror witherror codeinvalid argument.
Letrequired capabilities be the result ofgetting the property "alwaysMatch" fromcapabilities request.
Ifrequired capabilities isundefined, set the value to an empty JSONObject.
Letrequired capabilities be the result oftrying tovalidate capabilities with argumentsrequired capabilities andflag.
Letall first match capabilities be the result ofgetting the property "firstMatch" fromcapabilities request.
Ifall first match capabilities isundefined, set the value to aList with a single entry of an empty JSONObject.
Ifall first match capabilities is not aList with one or more entries, returnerror witherror codeinvalid argument.
Letvalidated first match capabilities be an emptyList.
For eachfirst match capabilities corresponding to an indexed property inall first match capabilities:
Letvalidated capabilities be the result oftrying tovalidate capabilities with argumentsfirst match capabilities andflags.
Appendvalidated capabilities tovalidated first match capabilities.
Letmerged capabilities be an emptyList.
For eachfirst match capabilities corresponding to an indexed property invalidated first match capabilities:
Letmerged be the result oftrying tomerge capabilities withrequired capabilities andfirst match capabilities as arguments.
Appendmerged tomerged capabilities.
For eachcapabilities corresponding to an indexed property inmerged capabilities:
Letmatched capabilities be the result oftrying tomatch capabilities withcapabilities as an argument.
Ifmatched capabilities is notnull, returnsuccess with datamatched capabilities.
When required tovalidate capabilities with argumentcapabilities:
Ifcapabilities is not a JSONObject return anerror witherror codeinvalid argument.
Letresult be an empty JSONObject.
For each enumerableown property incapabilities, run the following substeps:
Letname be the name of the property.
Letvalue be the result ofgetting a property namedname fromcapabilities.
Run the substeps of the first matching condition:
nullLetdeserialized be set tonull.
acceptInsecureCerts"Ifvalue is not aboolean return anerror witherror codeinvalid argument. Otherwise, letdeserialized be set tovalue.
browserName"browserVersion"platformName"Ifvalue is not astring return anerror witherror codeinvalid argument. Otherwise, letdeserialized be set tovalue.
pageLoadStrategy"Letdeserialized be the result oftrying todeserialize as a page load strategy with argumentvalue.
proxy"Letdeserialized be the result oftrying todeserialize as a proxy with argumentvalue.
strictFileInteractability"Ifvalue is not aboolean return anerror witherror codeinvalid argument. Otherwise, letdeserialized be set tovalue
timeouts"Letdeserialized be the result oftrying todeserialize as timeouts configuration withvalue.
unhandledPromptBehavior"Letdeserialized be the result oftrying todeserialize as an unhandled prompt behavior with argumentvalue.
Letdeserialized be the result oftrying to run theadditional capability deserialization algorithm for the extension capability corresponding toname, with argumentvalue.
Ifname is known to the implementation, letdeserialized be the result oftrying to deserializevalue in an implementation-specific way. Otherwise, letdeserialized be set tovalue.
Return anerror witherror codeinvalid argument.
Ifdeserialized is notnull,set a property onresult with namename and valuedeserialized.
Whenmerging capabilities with JSONObject argumentsprimary andsecondary, anendpoint node must take the following steps:
Letresult be a new JSONObject.
For each enumerableown property inprimary, run the following substeps:
Letname be the name of the property.
Letvalue be the result ofgetting a property namedname fromprimary.
Ifsecondary isundefined, returnresult.
For each enumerableown property insecondary, run the following substeps:
Letname be the name of the property.
Letvalue be the result ofgetting a property namedname fromsecondary.
Letprimary value be the result ofgetting the propertyname fromprimary.
Ifprimary value is notundefined, return anerror witherror codeinvalid argument.
Returnresult.
The algorithm outlined inmatching capabilities blithely ignores real-world problems that make implementation less than perfectly straightforward, particularly since capabilities can interact in unforeseen ways.
As an example, an implementation could have a capability that gives the path to the browser binary to use. This could cause bothbrowserName andbrowserVersion to be impossible to match against until the browser process is started.
Whenmatching capabilities given JSONObjectcapabilities, and asession configuration flagsflags, anendpoint node must take the following steps:
Letmatched capabilities be a JSONObject with the following entries:
browserName"browserVersion"platformName"acceptInsecureCerts"strictFileInteractability"setWindowRect"userAgent"Ifflags contains "http", add the following entries tomatched capabilities:
strictFileInteractability"Optionally addextension capabilities as entries tomatched capabilities. The values of these may be elided, and there is no requirement that allextension capabilities be added.
This allows aremote end to add information that might be useful to alocal end without unnecessarily bloating the response sent back to the user with (e.g.) an entire browser profile.
For example, an implementation could choose to indicate that a screenshot will be taken when returning an error by setting the capabilityse:screenshot-on-error totrue.
For eachname andvalue corresponding tocapabilities'sown properties:
Letmatch value equalvalue.
Run the substeps of the first matchingname:
browserName"Ifvalue is not a string equal to the "browserName" entry inmatched capabilities, returnsuccess with datanull.
There is a chance theremote end will need to start a browser process to correctly determine thebrowserName. Lightweight checks are preferred before this is done.
browserVersion"Comparevalue to the "browserVersion" entry inmatched capabilities using an implementation-defined comparison algorithm. The comparison is to accept avalue that places constraints on the version using the "<", "<=", ">", and ">=" operators.
If the two values do not match, returnsuccess with datanull.
Version comparison is left as an implementation detail since each user agent will likely have conflicting methods of encoding the user agent version, and standardizing these schemes is beyond the scope of this standard.
There is a chance theremote end will need to start a browser process to correctly determine thebrowserVersion. Lightweight checks are preferred before this is done.
platformName"Ifvalue is not a string equal to the "platformName" entry inmatched capabilities, returnsuccess with datanull.
The following platform names are in common usage with well-understood semantics and, whenmatching capabilities forplatform name, greatest interoperability can be achieved by honoring them as valid synonyms for well-known Operating Systems:
| Key | System |
|---|---|
"linux" | Any server or desktop system based upon the Linux kernel. |
"mac" | Any version of Apple's macOS. |
"windows" | Any version of Microsoft Windows, including desktop and mobile versions. |
This list is not exhaustive.
When returningcapabilities fromNew Session, it is valid to return a more specificplatformName, allowing users to correctly identify the Operating System the WebDriver implementation is running on.
acceptInsecureCerts"Ifaccept insecure TLS flag is set and not equal tovalue, returnsuccess with datanull.
If theendpoint node does not supportinsecure TLS certificates and this is the reason no match is ultimately made, it is useful to provide this information to thelocal end.
proxy"If thehas proxy configuration flag is set, or if the proxy configuration defined invalue is not one that passes theendpoint node's implementation-specific validity checks, returnsuccess with datanull.
Alocal end would only send this capability if it expected it to be honored and the configured proxy used. The intent is that if this is not possible a new session will not be established.
unhandledPromptBehavior"Ifcheck user prompt handler matches withvalue is false, returnsuccess with datanull.
Ifname is the name of anadditional WebDriver capability which defines amatched capability serialization algorithm, letmatch value be the result of running thematched capability serialization algorithm for capabilityname with argumentsvalue, andflags.
Otherwise, ifname is the key of anextension capability, letmatch value be the result oftrying implementation-specific steps to match onname withvalue. If the match is not successful, returnsuccess with datanull.
Ifmatch value is not null,set a property onmatched capabilities with namename and valuematch value.
Returnsuccess with datamatched capabilities.
A WebDriversession represents the logical connection between alocal end and a specificremote end. Thesession object holds state specific to that connection.
Anintermediary node will maintain anassociated session for each activesession. This is thesession on theupstream neighbor that is created when theintermediary node executes theNew Sessioncommand. Closing asession on anintermediary node will alsoclose the session of theassociated session.
Asession has asession ID, which is the string representation of aUUID used to uniquely identify the session. This is set when creating the session.
Asession has a booleanHTTP flag which is setwhen the session is created. A session with this flag set isanHTTP session.
Aremote end has an associated list ofactive sessions, which is a list of allsessions that are currently started.
Aremote end has an associated list ofactive HTTP sessions, which is a list of allHTTP sessions that are currently started.
The limitation of a single HTTP session forendpointnodes means that the first entry in the list ofactive HTTPsessions will be the only entry.
AHTTP session has an associatedcurrent browsing context, which is thebrowsing context against whichcommands will run, an associatedcurrent parent browsing context, which is set to the parent of thecurrent browsing context when changing browsing contexts, and an associatedcurrent top-level browsing context, which is set to the top-browsing context ancestor of thecurrent browsing context, when changing browsing contexts.
AnHTTP session has an associatedsessiontimeouts which is atimeouts configuration. This isinitially set to a newtimeouts configuration.
AnHTTP session has an associatedpage loadingstrategy, which is one of the keywords from thetable of pageload strategies. This is initially set tonormal.
AnHTTP session has an associatedstrict fileinteractability state which is a boolean. This is initially setto false.
Asession has an associatedbrowsing context inputstate map, which is aweak map withtop-level browsingcontexts as keys, andinput state objects as values. Thisis initially set to an empty map.
AnHTTP session has an associatedrequest queue which is aqueue ofrequests that are currently awaitingprocessing.
When a session is created, aset ofsession configurationflags are provided that define the features of the session. Thisspecification always creates sessions with "http"insession configuration flags, which corresponds totheHTTP flag. External specifications may define additionalflags, or create sessions without theHTTP flag.
In addition to per-session state, aremote end that isanendpoint node also has additional state that is globalacross all sessions.
Anendpoint node has an associatedaccept insecure TLS flag that indicates whether untrusted or self-signed TLS certificates are treated as trusted. The default value of the flag is false if the endpoint doesn't support accepting insecure TLS connections, or unset otherwise.
Anendpoint node has an associatedhas proxy configuration flag that indicates whether the proxy is already configured. The default value of the flag is true if the endpoint doesn't support proxy configuration, or false otherwise.
Tocreate a session, given a JSONObjectcapabilites, andsession configurationflagsflags:
Letsession id be the result ofgenerating a UUID.
Letsession be a newsession withsession IDsession id, andHTTP flagflags contains "http".
Letproxy be the result of getting property "proxy" fromcapabilities and run the substeps of the first matching statement:
Take implementation-defined steps to set the user agent proxy using the extractedproxy configuration. If the defined proxy cannot be configured returnerror witherror codesession not created. Otherwise set thehas proxy configuration flag to true.
proxy" and a value that is a new JSONObject.Ifcapabilites has a property named "acceptInsecureCerts", set theendpoint node'saccept insecure TLS flag to the result ofgetting a property named "acceptInsecureCerts" fromcapabilities.
Letuser prompt handler capability be the result of getting property "unhandledPromptBehavior" fromcapabilities.
Ifuser prompt handler capability is not undefined,update the user prompt handler withuser prompt handler capability.
Letserialized user prompt handler beserialize the user prompt handler.
Set a property oncapabilities with the name "unhandledPromptBehavior", and the valueserialized user prompt handler.
Ifflagscontains "http":
Letstrategy be the result of getting property "pageLoadStrategy" fromcapabilities.
Ifstrategy is a string, set thesession'spage loading strategy tostrategy. Otherwise, set thepage loading strategy tonormal andset a property ofcapabilities with name "pageLoadStrategy" and value "normal".
LetstrictFileInteractability be the result of getting property "strictFileInteractability" fromcapabilities. IfstrictFileInteractability is a boolean, setsession'sstrict file interactability tostrictFileInteractability.
Lettimeouts be the result of getting a property "timeouts" fromcapabilities. Iftimeouts is not undefined, setsession'ssession timeouts totimeouts.
Set a property oncapabilities with name "timeouts" and valueserialize the timeouts configuration withsession'ssession timeouts.
Process anyextension capabilities incapabilities in an implementation-defined manner.
Run anyWebDriver new session algorithm defined in external specifications, with argumentssession,capabilities, andflags.
Appendsession toactive sessions.
Ifflags contains "http", appendsession toactive HTTP sessions.
Set thewebdriver-active flag to true.
Toclose the session, givensession aremote end must take the following steps:
Ifsession'sHTTP flag is set, removesession fromactive HTTP sessions.
Removesession fromactive sessions.
Perform the following substeps based on theremote end's type:
If the list ofactive sessions is empty:
Set thewebdriver-active flag to false
Set theuser prompt handler to null.
Unset theaccept insecure TLS flag.
Reset thehas proxy configuration flag to its default value.
Optionally,close alltop-level browsing contexts, withoutprompting to unload.
Close theassociated session. If this causes anerror to occur, complete the remainder of this algorithm before returning theerror.
Perform any implementation-specific cleanup steps.
If anerror has occurred in any of the steps above, return theerror, otherwise returnsuccess with datanull.
Closing asession might cause the associated browser process to be killed. It is assumed that any implementation-specific cleanup steps are performedafter the response has been sent back to the client so that theconnection is not prematurely closed.
| HTTP Method | URI Template |
|---|---|
| POST | /session |
TheNew Sessioncommandcreates a new WebDriversession with theendpoint node.If the creation fails, asession not createderror is returned.
If theremote end is anintermediary node, it may use the result of thecapabilities processing algorithm to route thenew session request to the appropriateendpoint node. Anintermediary node is free to defineextension capabilities to assist in this process, however, these specific capabilities must not be forwarded to theendpoint node.
If theintermediary node requires additional information unrelated to user agent features, it is recommended that this information be passed as top-level parameters, and not as part of the requestedcapabilities. Anintermediary node must forward custom, top-level parameters (i.e. non-capabilities) to subsequentremote end nodes.
Anintermediary node might require authentication oncreating a new session. This authentication is an argument to theNew Session command itself and not the user agent'scapabilities. Therefore, the authentication should be passed as a top-level parameter and not embedded incapabilities:
{"user":"alice","password":"hunter2","capabilities": {…}}However, because anintermediary node cannot forwardextension capabilities specific to that implementation to anendpoint node, the following is also permitted by this specification:
{"capabilities":{"alwaysMatch":{"cloud:user":"alice","cloud:password":"hunter2","platformName":"linux"},"firstMatch":[{"browserName":"chrome"},{"browserName":"edge"}]}}Once allcapabilities are merged from this example, anendpoint node would receiveNew Session capabilities identical to:
[{"browserName":"chrome","platformName":"linux"},{"browserName":"edge","platformName":"linux"}]Theremote end steps, givensession,URLvariables andparameters are:
If the implementation is anendpoint node, and the list ofactive HTTP sessions is not empty, or otherwise if the implementation is unable to start an additional session, returnerror witherror codesession not created.
If theremote end is anintermediary node, take implementation-defined steps that either result in returning anerror witherror codesession not created, or in returning asuccess with data that is isomorphic to that returned byremote ends according to the rest of this algorithm. If anerror is not returned, theintermediary node must retain a reference to thesession created on theupstream node as theassociated session such that commands may be forwarded to thisassociated session on subsequent commands.
How this is done is entirely up to the implementation, but typically thesessionId, andURL andURL prefix of theupstreamremote end will need to be tracked.
Letflags be a set containing "http".
Letcapabilities be the result oftrying toprocess capabilities withparameters andflags.
Ifcapabilities's isnull, returnerror witherror codesession not created.
Letsession be the result ofcreate a session, withcapabilities, andflags.
Letbody be a JSONObject initialized with:
sessionId"capabilities"Setsession'current top-level browsing context to one of theendpoint node'stop-level browsing contexts, preferring thetop-level browsing context that hassystem focus, or otherwise preferring anytop-level browsing context whosevisibility state isvisible.
WebDriver implementations typically start a completely new browser instance, but there is no requirement in this specification (or for WebDriver only to be used to automate only web browsers). Implementations might choose to use an existing browser instance, eg. by selecting the window that currently has focus.
Set therequest queue to a newqueue.
Returnsuccess with databody.
| HTTP Method | URI Template |
|---|---|
| DELETE | /session/{session id} |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession is anactive HTTP session,try toclose the session withsession.
| HTTP Method | URI Template |
|---|---|
| GET | /status |
Status returns information about whether aremote end is in a state in which it can createnew sessions, but may additionally include arbitrary meta information that is specific to the implementation.
Theremote end'sreadiness state is represented by theready property of the body, which is false if an attempt tocreate a session at the current time would fail. However, the value true does not guarantee that aNew Session command will succeed.
Implementations may optionally include additional meta information as part of the body, but the top-level propertiesready andmessage are reserved and must not be overwritten.
Theremote end steps, givensession,URLvariables andparameters are:
Letbody be a new JSONObject with the following properties:
ready"message"An implementation-defined string explaining theremote end'sreadiness state.
Returnsuccess with databody.
Atimer is astruct. It hasatimeout fired flag, which is aboolean, initially false.
Tostart the timer giventimer andtimeout
Assert:timeout is not null.
Run the following stepsin parallel:
Wait for at leasttimeout milliseconds to pass.
Settimer'stimeout fired flag to true.
Atimeouts configuration is astruct representingthe timeouts forscript evaluation,navigation, andelementretrieval. It has ascripttimeoutitem which is an integer or null and isinitially set to 30,000, apage loadtimeoutitem which is an integer or null and isinitially set to 300,000, and animplicitwait timeoutitem which is an integer or null and isinitially set to 0.Todeserialize as timeouts configuration giventimeouts:
Settimeouts to the result ofconverting a JSON-derived JavaScript value to an Infra value withtimeouts.
Letconfiguration be a newtimeouts configuration.
For eachkey →value intimeouts:
If «"script", "pageLoad", "implicit"» does notcontainkey, then continue.
Ifvalue is neither null nor a number greater than or equal to 0 and less than or equal to themaximum safe integer returnerror witherror codeinvalid argument.
Run the substeps matchingkey:
script"Setconfiguration'sscript timeout tovalue.
pageLoad"Setconfiguration'spage load timeout tovalue.
implicit"Setconfiguration'simplicit wait timeout tovalue.
Returnsuccess with dataconfiguration.
Letserialized be an emptymap.
Setserialized["script"] totimeouts'script timeout.
Setserialized["pageLoad"] totimeouts'page load timeout.
Setserialized["implicit"] totimeouts'implicit wait timeout.
Returnconvert an Infra value to a JSON-compatible JavaScript value withserialized.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/timeouts |
Theremote end steps, givensession,URLvariables andparameters are:
Lettimeouts beserialize the timeouts configuration withsession'stimeouts configuration
Returnsuccess with datatimeouts.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/timeouts |
Theremote end steps, givensession,URLvariables andparameters are:
Lettimeouts be the result oftrying todeserialize as timeouts configuration withparameters.
Setsession'stimeouts configuration totimeouts.
Thecommands in this section allow navigation of thesession'scurrent top-level browsing context to new URLs and introspection of the document currently loaded in thisbrowsing context.
Forcommands that cause a new document to load, the point at which the command returns is determined by the session'spage loading strategy. Thenormal state causes it to return after theloadevent fires on the new page,eager causes it to return after theDOMContentLoadedevent fires, andnone causes it to return immediately.
Navigation actions are also affected by the value of thepage load timeout, which determines the maximum time that commands will block before returning with atimeouterror.
The following is thetable of page load strategies that links thepageLoadStrategycapability keyword to apage loading strategy state, and shows whichdocument readiness state that corresponds to it:
| Keyword | Page load strategy state | Document readiness state |
|---|---|---|
"none" | none | |
"eager" | eager | "interactive" |
"normal" | normal | "complete" |
When asked todeserialize as a page load strategy with argumentvalue:
Ifvalue is not astring return anerror witherror codeinvalid argument.
If there is no entry in thetable of page load strategies withkeywordvalue return anerror witherror codeinvalid argument.
Returnsuccess with datavalue.
Towait for navigation to complete, givensession and optionaltimer (default null):
Ifsession'spage loading strategy isnone, returnsuccess with datanull.
Ifsession'scurrent browsing context isno longer open, returnsuccess with datanull.
Lettimeout besession timeouts'page load timeout.
Iftimer is null:
Settimer to a newtimer.
Iftimeout is not null:
Start the timer withtimer andtimeout.
Run these steps, butabort whentimer'stimeout fired flag is set:
If there is an ongoing attempt tonavigatesession'scurrent browsing context that has not yetmatured, wait for navigation tomature.
Letreadiness target be thedocument readiness state associated with thesession'spage loading strategy, which can be found in thetable of page load strategies.
Wait forsession'scurrent browsing context'sdocument readiness state to reachreadiness target.
If aborted return anerror witherror codetimeout.
When asked to run thepost-navigation checks, run the substeps of the first matching statement:
Returnerror witherror codeunknown error.
A "network error" in this case is not an HTTP response with a status code indicating an unsuccessful result, but could be a problem occurring lower in the OSI model, or a failed DNS lookup.
If theremote end'saccept insecure TLS state is true, take implementation specific steps to ensure the navigation is not aborted and that the untrusted or invalid TLS certificate error that would normally occur under these circumstances, are suppressed.
Otherwise returnerror witherror codeinsecure certificate.
Irrespective of how a possible authentication challenge is handled, returnsuccess with datanull.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/url |
The command causes the user agent tonavigate thesession'scurrent top-level browsing context to a new location.
If theremote end'saccept insecure TLS flag is true, no certificate errors that would normally cause the user agent to abort and show a security warning are to hinder navigation to the requested address.
To navigate thecurrent top-level browsing context of thesession with ID1 tohttps://example.com, thelocal end would POST to/session/1/url with the body:
{"url":"https://example.com"}Theremote end steps, givensession,URLvariables andparameters are:
LetURL be the result ofgetting a property named "url" fromparameters.
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
IfURL is not anabsolute URL or is not anabsolute URL with fragment or not alocal scheme, returnerror witherror codeinvalid argument.
Try tohandle any user prompts withsession.
Lettimeout besession'ssession timeoutspage load timeout.
Letcurrent URL besession'scurrent top-level browsing context'sactive document'sURL.
Ifcurrent URL andURL do not have the sameabsolute URL andtimeout is not null:
Settimer to a newtimer.
Start the timer withtimer andtimeout.
Run these steps, butabort whentimer'stimeout fired flag is set:
Navigatesession'scurrent top-level browsing context toURL.
IfURLis special except forfile andcurrent URL andURL do not have the sameabsolute URL :
Try towait for navigation to complete withsession andtimer.
Try to run thepost-navigation checks.
Set the current browsing context withsession andcurrent top-level browsing context.
Whilesession'scurrent top-level browsing context contains arefresh state pragma directive oftime 1 second or less, run the following steps:
Setcurrent URL tosession'scurrent top-level browsing context'sactive document'sURL.
Wait until the refresh timeout has elapsed and newnavigate ofsession'scurrent top-level browsing context has begun.
SetURL to the destination URL ofsession'scurrent top-level browsing context'sactive document's ongoing navigation.
IfURLis special except forfile andcurrent URL andURL do not have the sameabsolute URL :
Try towait for navigation to complete withsession andtimer.
Try to run thepost-navigation checks.
If aborted return anerror witherror codetimeout.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/url |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
LetURL be theserialization ofsession'scurrent top-level browsing context'sactive document'sURL.
Returnsuccess with dataURL.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/back |
This command causes the browser to traverse one step backward in thejoint session history ofsession'scurrent top-level browsing context. This is equivalent to pressing the back button in thebrowser chrome or invokingwindow.history.back.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Lettimeout besession'session timeoutspage load timeout.
Lettimer be a newtimer.
Iftimeout is not null:
Start the timer withtimer andtimeout.
Traverse the history by a delta –1 forsession'scurrent browsing context.
If the previous step completed results in apageHideevent firing, wait untilpageShowevent fires ortimer'timeout fired flag to be set, whichever occurs first.
Iftimer'timeout fired flag is set:
Returnerror witherror codetimeout.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/forward |
This command causes the browser to traverse one step forwards in thejoint session history ofsession'scurrent top-level browsing context. This is equivalent to pressing the forward button in thebrowser chrome or invokingwindow.history.forward.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Lettimeout besession'session timeoutspage load timeout.
Lettimer be a newtimer.
Iftimeout is not null:
Start the timer withtimer andtimeout.
Traverse the history by a delta 1 forsession'scurrent browsing context.
If the previous step completed results in apageHideevent firing, wait untilpageShowevent fires ortimer'timeout fired flag to be set, whichever occurs first.
Iftimer'timeout fired flag is set:
Returnerror witherror codetimeout.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/refresh |
This command causes the browser to reload the page insession'scurrent top-level browsing context.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Initiatean overridden reload ofsession'scurrent top-level browsing context'sactive document.
IfURLis special except forfile:
Try towait for navigation to complete withsession.
Try to run thepost-navigation checks.
Set the current browsing context withsession andsession'scurrent top-level browsing context.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/title |
This command returns the document title ofsession'scurrent top-level browsing context, equivalent to callingdocument.title.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Lettitle be thesession'scurrent top-level browsing context'sactive document'stitle.
Returnsuccess with datatitle.
Many WebDrivercommands happen in the context of eithersession'scurrent browsing context orcurrent top-level browsing context.session'scurrent top-level browsing context is represented in the protocol by its associatedwindow handle. When atop-level browsing context is selected using theSwitch To Window command, a specificbrowsing context can be selected using theSwitch to Frame command.
The use of the term “window” to refer to atop-level browsing context is legacy and doesn't correspond with either the operating system notion of a “window” or the DOMWindow object.
Abrowsing context is said to beno longer open if itsnavigable has been destroyed.
Eachbrowsing context has an associatedwindow handle which uniquely identifies it. This must be aString and must not be "current".
Aweb frame is an abstraction used to identify aframe oriframe when it is transported via theprotocol, betweenremote andlocal ends.
Theweb frame identifier is the string constant "frame-075b-4da1-b6ba-e579c2d3230a".
An ECMAScriptObjectrepresents a web frame if it has aweb frame identifierown property.
Aweb window is an abstraction used to identify awindow when it is transported via theprotocol, betweenremote andlocal ends.
Theweb window identifier is the string constant "window-fcc6-11e5-b4f8-330a88ab9d7f".
An ECMAScriptObjectrepresents a web window if it has aweb window identifierown property.
TheWindowProxy reference object withWindowProxy objectwindow is given by:
Letidentifier be theweb window identifier if the associatedbrowsing context ofwindow is atop-level browsing context.
Otherwise let it be theweb frame identifier.
Return a JSONObject initialized with the following properties:
Associatedwindow handle of thewindow'sbrowsing context.
Todeserialize a web frame by a JSONObjectobject thatrepresents a web frame:
Ifobject has noown propertyweb frame identifier, returnerror witherror codeinvalid argument.
Letreference be the result ofgetting theweb frame identifier property fromobject.
Ifreference is not aString, return anerror witherror codeinvalid argument.
Letbrowsing context be thebrowsing context whosewindow handle isreference, or null if no suchbrowsing context exists.
Ifbrowsing context is null or atop-level browsing context, returnerror witherror codeno such frame.
Returnsuccess with databrowsing context's associated window.
Todeserialize a web window by a JSONObjectobject thatrepresents a web window:
Ifobject has noown propertyweb window identifier, returnerror witherror codeinvalid argument.
Letreference be the result ofgetting theweb window identifier property fromobject.
Ifreference is not aString, return anerror witherror codeinvalid argument.
Letbrowsing context be thebrowsing context whosewindow handle isreference, or null if no suchbrowsing context exists.
Ifbrowsing context is null or not atop-level browsing context, returnerror witherror codeno such window.
Returnsuccess with databrowsing context's associated window.
When required toset the current browsing context givensession andcontext, an implementation must follow the following steps:
Setsession'scurrent browsing context tocontext.
Set thesession'scurrent parent browsing context to theparent browsing context ofcontext, if that context exists, ornull otherwise.
When required toset the current top-level browsing context givensession andcontext, an implementation must:
Assert:context is atop-level browsing context.
Setsession'scurrent top-level browsing context tocontext.
Set the current browsing context withsession andcontext.
In accordance withthefocussection of the [HTML] specification,commands are unaffected by whether the operating system window has focus or not.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/window |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Returnsuccess with data being thewindow handle associated withsession'scurrent top-level browsing context.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| DELETE | /session/{session id}/window |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Closesession'scurrent top-level browsing context.
If there are no more opentop-level browsing contexts, thentry toclose the session.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/window |
Switching window will selectsession'scurrent top-levelbrowsing context used as the target for allsubsequentcommands. In a tabbed browser, this will typicallymake the tab containing thebrowsing context the selected tab.
Theremote end steps, givensession,URLvariables andparameters are:
Lethandle be the result ofgetting the property "handle" fromparameters.
Ifhandle isundefined, returnerror witherror codeinvalid argument.
If there is an activeuser prompt, that prevents the focusing of anothertop-level browsing context, returnerror witherror codeunexpected alert open.
Ifhandle is equal to the associatedwindow handle for sometop-level browsing context, letcontext be the that browsing context, andset the current top-level browsing context withsession andcontext.
Otherwise, returnerror witherror codeno such window.
Update any implementation-specific state that would result from the user selectingsession'scurrent browsing context for interaction, without altering OS-level focus.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/window/handles |
The order in which the window handles are returned is arbitrary.
Theremote end steps, givensession,URLvariables andparameters are:
Lethandles be aList.
For eachtop-level browsing context in theremote end, push the associatedwindow handle ontohandles.
In order to determine whether or not a particular interaction with the browser opens a new window, one can obtain the set of window handles before the interaction is performed and compare it with the set after the action is performed.
This feature has limited support.
| Chrome | No |
| Chrome Android | ? |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 66+ |
| Firefox Android | ? |
| Opera | ? |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/window/new |
Create a newtop-level browsing context.
Theremote end steps, givensession,URLvariables andparameters are:
If the implementation does not support creating new top-level browsing contexts, returnerror witherror codeunsupported operation.
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Lettype hint be the result ofgetting the property "type" fromparameters.
Create a newtop-level browsing context by running thewindow open steps withURL set to "about:blank",target set to the empty string, andfeatures set to "noopener" and the user agent configured to create a new browsing context. This must be done without invoking thefocusing steps for the created browsing context. Iftype hint has the value "tab", and the implementation supports multiple browsing context in the same OS window, the new browsing context should share an OS window withsession'scurrent browsing context. Iftype hint is "window", and the implementation supports multiple browsing contexts in separate OS windows, the created browsing context should be in a new OS window. In all other cases the details of how the browsing context is presented to the user are implementation defined.
Lethandle be the associatedwindow handle of the newly created window.
Lettype be "tab" if the newly created window shares an OS-level window withsession'scurrent browsing context, or "window" otherwise.
Letresult be a new JSONObject initialized with:
handle"type"Returnsuccess with dataresult.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/frame |
TheSwitch To Frame command is used to selectsession'scurrent top-level browsing context or achild browsing context ofsession'scurrent browsing context to use assession'scurrent browsing context for subsequentcommands.Theremote end steps, givensession,URLvariables andparameters are:
Letid be the result ofgetting the property "id" fromparameters.
Ifid is notnull, aNumber object, or anObject thatrepresents a web element, returnerror witherror codeinvalid argument.
Run the substeps of the first matching condition:
nullIfsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Set the current browsing context withsession andsession'scurrent top-level browsing context.
Number objectIfid is less than 0 or greater than 216 – 1, returnerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letwindow be theassociated window ofsession'scurrent browsing context'sactive document.
Ifid is not asupported property index ofwindow, returnerror witherror codeno such frame.
Letchild window be theWindowProxy object obtained by callingwindow.[[GetOwnProperty]] (id).
Set the current browsing context withsession andchild window'sbrowsing context.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andid.
Ifelement is not aframe oriframe element, returnerror witherror codeno such frame.
Set the current browsing context withsession andelement'scontent navigable'sactive browsing context.
Update any implementation-specific state that would result from the user selectingsession'scurrent browsing context for interaction, without altering OS-level focus.
WebDriver is not bound by the same origin policy, so it is always possible to switch into child browsing contexts, even if they are different origin to the current browsing context.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/frame/parent |
TheSwitch to Parent Framecommand setssession'scurrent browsing context for futurecommands to the parent ofsession'scurrent browsing context.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context is already thetop-level browsing context:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Ifsession'scurrent parent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Ifsession'scurrent parent browsing context is notnull,set the current browsing context withsession andcurrent parent browsing context.
Update any implementation-specific state that would result from the user selectingsession'scurrent browsing context for interaction, without altering OS-level focus.
WebDriver providescommands for interacting with the operating system window containingsession'scurrent top-level browsing context. Because different operating systems' window managers provide different abilities, not all of the commands in this section can be supported by allremote ends. Support for thesecommands is determined by thewindow dimensioning/positioningcapability. Where acommand is not supported, anunsupported operationerror is returned.
Thetop-level browsing context has an associatedwindow state which describes what visibility state its OS widget window is in. It can be in one of the following states:
| State | Keyword | Default | Description |
|---|---|---|---|
| Maximized window state | "maximized" | The window is maximized. | |
| Minimized window state | "minimized" | The window is iconified. | |
| Normal window state | "normal" | ✓ | The window is shown normally. |
| Fullscreen window state | "fullscreen" | The window is in full screen mode. |
If for whatever reason thetop-level browsing context'sOS window cannot enter either of thewindow states, or if thisconcept is not applicable on the current system, the default statemust benormal.
TheWindowRect object foraWindowProxy,window is anObject initializedwith the following properties:
x"window'sscreenX attribute.
y"window'sscreenY attribute.
width"windows'souterWidth attribute.
height"window'souterHeight attribute.
Tomaximize the window, given an operating system level window with an associatedtop-level browsing context, run the implementation-specific steps to transition the operating system level window into themaximized window state. If the window manager supports window resizing but does not have a concept of window maximization, the window dimensions must be increased to the maximum available size permitted by the window manager for the current screen. Return when the window has completed the transition, or within an implementation-defined timeout.
Toiconify the window, given an operating system level window with an associatedtop-level browsing context, run implementation-specific steps to transition the operating system level window into theminimized window state. Do not return from this operation until thevisibility state of thetop-level browsing context'sactive document has reached thehidden state, or until the operation times out.
Torestore the window, given an operating system level window with an associatedtop-level browsing context, run implementation-specific steps to restore or unhide the window to the visible screen. Do not return from this operation until thevisibility state of thetop-level browsing context'sactive document has reached thevisible state, or until the operation times out.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/window/rect |
TheGet Window Rectcommand returns the size and position on the screen of the operating system window corresponding tosession'scurrent top-level browsing context.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Returnsuccess with data set to theWindowRect object for thesession'scurrent top-level browsing context.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/window/rect |
TheSet Window Rectcommandalters the size and the position of the operating system windowcorresponding tosession'scurrent top-level browsing context.
Theremote end steps, givensession,URLvariables andparameters are:
Letwidth be the result ofgetting a property named "width" fromparameters.
Ifwidth isundefined, letwidth be null.
Letheight be the result ofgetting a property named "height" fromparameters.
Ifheight isundefined, letheight be null.
Letx be the result ofgetting a property named "x" fromparameters.
Ifx isundefined, letx be null.
Lety be the result ofgetting a property named "y" fromparameters.
Ify isundefined, lety be null.
Ifwidth orheight is neither null, nor aNumber from 0 to 231 − 1, returnerror witherror codeinvalid argument.
Ifx ory is neither null, nor aNumber from −(231) to 231 − 1, returnerror witherror codeinvalid argument.
If theremote end does not support theSet Window Rectcommand forsession'scurrent top-level browsing context for any reason, returnerror witherror codeunsupported operation.
In case theSet Window Rect command is partially supported (i.e. some combinations of arguments are supported but not others), the implmentation is expected to continue with the remaining steps.
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letwindow be the operating system window containingsession'scurrent top-level browsing context
If the implementation is able to set the dimensions ofwindow:
Ifwidth is not null, set the width, inCSS pixels, ofwindow, including anybrowser chrome and externally drawn window decorations, to a value that is as close as possible towidth.
Ifheight is not null, set the height, inCSS pixels, ofwindow, including anybrowser chrome and externally drawn window decorations, to a value that is as close as possible toheight.
The specification does not guarantee that the resulting window size will exactly match that which was requested. In particular the implementation is expected to clamp values that are larger than the physical screen dimensions, or smaller than the minimum window size.
Particular implementations may have other limitations such as not being able to resize in single-pixel increments.
This is intended to mutate the value ofsession'scurrent top-level browsing context'sWindowProxy'souterWidth andouterHeight properties. Specifically, the value ofouterWidth should be as close as possible towidth and the value ofouterHeight should be as close as possible toheight.
If the implementation is able to set the position ofwindow:
Ifx is not null, set the x-coordinate of the left edge ofwindow to a value that is as close as possible tox.
Ify is not null, set the y-coordinate of the top edge ofwindow to a value that is as close as possible toy.
The specification does not guarantee that the resulting window position will match that which was requested.
This step is similar to calling themoveTo(x, y) method on theWindowProxy object associated withsession'scurrent top-level browsing context, but without thesecurity restrictions that you
window.open.Returnsuccess with data set to theWindowRect object for thesession'scurrent top-level browsing context.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/window/maximize |
TheMaximize Window command invokes the window manager-specific “maximize” operation, if any, on the window containingsession'scurrent top-level browsing context. This typically increases the window to the maximum available size without going full-screen.
Theremote end steps, givensession,URLvariables andparameters are:
If theremote end does not support theMaximize Window command forsession'scurrent top-level browsing context for any reason, returnerror witherror codeunsupported operation.
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Maximize the window ofsession'scurrent top-level browsing context.
Returnsuccess with data set to theWindowRect object for thesession'scurrent top-level browsing context.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/window/minimize |
TheMinimize Window command invokes the window manager-specific “minimize” operation, if any, on the window containingsession'scurrent top-level browsing context. This typically hides the window in the system tray.
Theremote end steps, givensession,URLvariables andparameters are:
If theremote end does not support theMinimize Window command forsession'scurrent top-level browsing context for any reason, returnerror witherror codeunsupported operation.
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Returnsuccess with data set to theWindowRect object for thesession'scurrent top-level browsing context.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/window/fullscreen |
Theremote end steps, givensession,URLvariables andparameters are:
If theremote end does notsupport fullscreen returnerror witherror codeunsupported operation.
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Callfullscreen an element withsession'scurrent top-level browsing context'sactive document'sdocument element.
The window is now in theFullscreen window state.
Returnsuccess with data set to theWindowRect object for thesession'scurrent top-level browsing context.
Aweb element is an abstraction used to identify anelement when it is transported via theprotocol, betweenremote andlocal ends.
Theweb element identifier is the string constant "element-6066-11e4-a52e-4f735466cecf".
An ECMAScriptObjectrepresents a web element if it has aweb element identifierown property.
TheWebDriver node id is a globally unique stringrepresenting a handle to a DOM node in a specificWebDriversession.
Aweak map is amap in which keys are heldweakly i.e. items are removed if the key object is garbaged collected, andpresence in the map does not prevent garbage collection. This acts as analternative to defining properties directly on the key objects.
Unlike the ECMAScriptWeakMap,aweak map can participate in the full set of operations available fora Map.
A WebDriversession has abrowsing context group nodemap, which is aweak map between abrowsing context groupand anode id map.
Anode id map isweak map between nodes and theircorrespondingWebDriver node id.
A WebDriversession has anavigable seen nodes mapwhich is aweak map between anavigable and a set.
Toget a node givensession,browsing context, andreference:
Toget or create a node referencegivensession,browsing context, andnode:
Returnnode id map[node].
Anode reference is known givensession,browsingcontext, andreference if the following steps return true:
Toget a known element givensession andreference:
Element returnerror witherror codeno such element.Toget or create a web element reference givensession andelement:
Element.Theweb element reference object forsessionandelement is:
Letidentifier be theweb element identifier.
Letreference be the result ofget or create a web element reference withsession andelement.
Return a JSONObject initialized with a property with nameidentifier and valuereference.
Todeserialize a web element by a JSONObjectobject thatrepresents a web element:
Ifobject has noown propertyweb element identifier, returnerror witherror codeinvalid argument.
Letreference be the result ofgetting theweb element identifier property fromobject.
Ifreference is not aString, return anerror witherror codeinvalid argument.
Letelement be the result oftrying toget a known element withsession andreference.
Returnsuccess with dataelement.
Anelementis stale if itsnode document is not theactive document or if it is notconnected.
Toscroll into view anelement perform the following steps only if the element is not alreadyin view:
Letoptions be the followingScrollIntoViewOptions:
behavior"instant"block"end"inline"nearest"RunFunction.[[Call]](scrollIntoView,options) withelement as the this value.
Editableelements are those that can be used fortyping andclearing, and they fall into two subcategories:
Denotesinput elements that aremutable (e.g. that are notread only ordisabled) and whosetype attribute is in one of the following states:
And thetextarea element.
Denotes elements that areediting hosts orcontent editable.
Anelement is said to havepointer events disabled if theresolved value of its "pointer-events" style property is "none".
Anelement is to be consideredread only if it is aninput element whosereadonly attribute is set.
In order to determine if anelement can be interacted with using pointer actions, WebDriver performs hit-testing to find if the interaction will be able to reach the requested element.
Aninteractable element is anelement which is eitherpointer-interactable orkeyboard-interactable.
Apointer-interactable element is defined to be the firstelement, defined by thepaint order found at thecenter point of its rectangle that is inside theviewport, excluding the size of any rendered scrollbars.
Akeyboard-interactable element is anyelement that has afocusable area, is abody element, or is thedocument element.
Anelement'sin-view center point is the origin position of the rectangle that is the intersection between the element's firstDOMRect ofgetClientRects() and theinitial viewport. It can be calculated this way:
Letrectangle be the first object of theDOMRect collection returned by callinggetClientRects() onelement.
Letleft bemax(0,min(x coordinate,x coordinate +width dimension)).
Letright bemin(innerWidth,max(x coordinate,x coordinate +width dimension)).
Lettop bemax(0,min(y coordinate,y coordinate +height dimension)).
Letbottom bemin(innerHeight,max(y coordinate,y coordinate +height dimension)).
Letx befloor((left +right) ÷ 2.0).
Lety befloor((top +bottom) ÷ 2.0).
Return the pair of (x,y).
Anelementelement isdisabled if the following steps return true:
Ifelement is anoption element orelement is anoptgroup element:
For eachinclusive ancestorancestor ofelement:
Ifancestor is anoptgroup element orancestor is aselect element, andancestor isactually disabled, return true.
Return false.
Returnelement isactually disabled.
Anelement isin view if it is a member of its ownpointer-interactable paint tree, given the pretense that itspointer events are not disabled.
Anelement isobscured if thepointer-interactable paint tree at itscenter point is empty, or the first element in this tree is not aninclusive descendant of itself.
This ascertains if theelement'sin-view center point would be possible tointeract with.
For example, thepaint tree at this button'scenter point, the red square, is not itself the button or adescendant of the button. In other words, it is not aninclusive descendant. This makes the buttonobscured:
On the other hand, thecenter point of the following select list is the thirdoption element, because unlike a drop-down list,<select multiple>'s options are individually visible and painted. Because the option is adescendant of theselect element, it isnotobscured:
Anelement'spointer-interactable paint tree is produced this way:
Ifelement isnot in the same tree assession'scurrent browsing context'sactive document, return an empty sequence.
Letrectangles be theDOMRect sequence returned by callinggetClientRects().
Ifrectangles has the length of 0, return an empty sequence.
Letcenter point be thein-view center point of the first indexed element inrectangles.
Return theelements from point given the coordinatescenter point.
Ashadow root is an abstraction used to identify ashadow root when it is transported via theprotocol, betweenremote andlocal ends.
Theshadow root identifier is the string constant "shadow-6066-11e4-a52e-4f735466cecf".
An ECMAScriptObjectrepresents a shadow root if it has ashadow root identifierown property.
Toget a known shadow root givensession andreference:
ShadowRoot returnerror witherror codeno such shadow root.Toget or create a shadow root reference givensession andshadow root:
ShadowRoot.Theshadow root reference object forsession andshadow root is given by:
Letidentifier be theshadow root identifier.
Letreference be the result ofget or create a shadow root reference withsession andshadow root.
Return a JSONObject initialized with a property with nameidentifier and valuereference.
When required todeserialize a shadow root by a JSONObjectobject thatrepresents a shadow root:
Ifobject has noown propertyshadow root identifier, returnerror witherror codeinvalid argument.
Letreference be the result ofgetting theshadow root identifier property fromobject.
Ifreference is not aString, return anerror witherror codeinvalid argument.
Letshadow be the result oftrying toget a known shadow root withsession andreference.
Returnsuccess with datashadow.
Ashadow rootis detached if itsnode document is not theactive document or if the element node referred to as itshostis stale.
TheFind Element,Find Elements,Find Element From Element,Find Elements From Element,Find Element From Shadow Root, andFind Elements From Shadow Rootcommands allow lookup of individual elements and collections of elements. Element retrieval searches are performed using pre-order traversal of the document's nodes that match the provided selector's expression.
When required tofind givensession,start node,using andvalue, aremote end must run the following steps:
Letlocation strategy be equal tousing.
Letselector be equal tovalue.
Lettimeout besession'ssession timeouts'implicit wait timeout.
Lettimer be a newtimer.
Iftimeout is not null:
Start the timer withtimer andtimeout.
Letelements returned be an emptyList.
Whileelements returned is empty andtimer'stimeout fired flag is not set:
Setelements returned to the result oftrying to call the relevantelement location strategy with argumentsstart node, andselector.
DOMException,SyntaxError,XPathException, or other error occurs during the execution of theelement location strategy, returnerrorinvalid selector.Letresult be an emptyList.
For eachelement inelements returned, append theweb element reference object forsession andelement, toresult.
Returnsuccess with dataresult.
Anelement location strategy is anenumerated attribute deciding what technique should be used to search forelements insession'scurrent browsing context. The followingtable of location strategies lists the keywords and states defined for this attribute:
| State | Keyword |
|---|---|
| CSS selector | "css selector" |
| Link text selector | "link text" |
| Partial link text selector | "partial link text" |
| Tag name | "tag name" |
| XPath selector | "xpath" |
To find aweb element with theCSS Selectorstrategy the following steps need to be completed:
Letelements be the result of callingquerySelectorAll() withstart node asthis andselector as the argument. If this causes an exception to be thrown, returnerror witherror codeinvalid selector.
Returnsuccess with dataelements.
To find aweb element with theLink Textstrategy the following steps need to be completed:
Letelements be the result of callingquerySelectorAll() withstart node asthis and "a" as the argument. If this throws an exception, returnerror witherror codeunknown error.
Letresult be an emptyNodeList.
For eachelement inelements:
Letrendered text be the value that would be returned via a call toGet Element Text forelement.
Lettrimmed text be the result of removing allwhitespace from the start and end of the stringrendered text.
Iftrimmed text equalsselector, appendelement toresult.
Returnsuccess with dataresult.
ThePartial link textstrategy is very similar to theLink Textstrategy, but rather than matching the entire string, only a substring needs to match. That is, return alla elements with rendered text that contains the selector expression.
To find aweb element with thePartial Link Textstrategy the following steps need to be completed:
Letelements be the result of callingquerySelectorAll() withstart node asthis and "a" as the argument. If this throws an exception, returnerror witherror codeunknown error.
Letresult be an emptyNodeList.
For eachelement inelements:
Letrendered text be the value that would be returned via a call toGet Element Text forelement.
Ifrendered text containsselector, appendelement toresult.
Returnsuccess with dataresult.
To find aweb element with theTag Namestrategy returnsuccess with data set to the result of callinggetElementsByTagName() withstart node asthis andselector as the argument.
To find aweb element with theXPath Selectorstrategy the following steps need to be completed:
LetevaluateResult be the result of callingevaluate, with argumentsselector,start node,null,ORDERED_NODE_SNAPSHOT_TYPE, andnull.
A snapshot is used to promote operation atomicity.
Letindex be 0.
Letlength be the result ofgetting the property "snapshotLength" fromevaluateResult. If this throws anXPathException returnerror witherror codeinvalid selector, otherwise if this throws any other exception returnerror witherror codeunknown error.
Letresult be an emptyNodeList.
Repeat, whileindex is less thanlength:
Ifnode is not anelement return anerror witherror codeinvalid selector.
Returnsuccess with dataresult.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/element |
TheFind Elementcommand is used to findanelement insession'scurrent browsingcontext that can be used as theweb element context forfuture element-centriccommands.
For example, consider this pseudo codewhich retrieves an element with the#toremove IDand uses this as the argument for a script it injectsto remove it from the HTML document:
let body = session.find.css("#toremove");session.execute("arguments[0].remove()", [body]);Theremote end steps, givensession,URLvariables andparameters are:
Letlocation strategy be the result ofgetting a property named "using" fromparameters.
Iflocation strategy is not present as a keyword in thetable of location strategies, returnerror witherror codeinvalid argument.
Letselector be the result ofgetting a property named "value" fromparameters.
Ifselector isundefined, returnerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letstart node besession'scurrent browsing context'sdocument element.
Ifstart node isnull, returnerror witherror codeno such element.
Letresult be the result oftrying toFind withsession,start node,location strategy, andselector.
Ifresult is empty, returnerror witherror codeno such element. Otherwise, return the first element ofresult.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/elements |
Theremote end steps, givensession,URLvariables andparameters are:
Letlocation strategy be the result ofgetting a property named "using" fromparameters.
Iflocation strategy is not present as a keyword in thetable of location strategies, returnerror witherror codeinvalid argument.
Letselector be the result ofgetting a property named "value" fromparameters.
Ifselector isundefined, returnerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letstart node besession'scurrent browsing context'sdocument element.
Ifstart node isnull, returnerror witherror codeno such element.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/element/{element id}/element |
Theremote end steps, givensession,URLvariables andparameters are:
Letlocation strategy be the result ofgetting a property named "using" fromparameters.
Iflocation strategy is not present as a keyword in thetable of location strategies, returnerror witherror codeinvalid argument.
Letselector be the result ofgetting a property named "value" fromparameters.
Ifselector isundefined, returnerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letstart node be the result oftrying toget a known element withsession andURL variables["element id"].
Ifresult is empty, returnerror witherror codeno such element. Otherwise, return the first element ofresult.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/element/{element id}/elements |
Theremote end steps, givensession,URLvariables andparameters are:
Letlocation strategy be the result ofgetting a property named "using" fromparameters.
Iflocation strategy is not present as a keyword in thetable of location strategies, returnerror witherror codeinvalid argument.
Letselector be the result ofgetting a property named "value" fromparameters.
Ifselector isundefined, returnerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letstart node be the result oftrying toget a known element withsession andURL variables["element id"].
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/shadow/{shadow id}/element |
Theremote end steps, givensession,URLvariables andparameters are:
Letlocation strategy be the result ofgetting a property called "using".
Iflocation strategy is not present as a keyword in thetable of location strategies, returnerror witherror codeinvalid argument.
Letselector be the result ofgetting a property called "value".
Ifselector isundefined, returnerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Handle any user prompts and return its value if it is anerror.
Letstart node be the result oftrying toget a known shadow root withsession andURL variables["shadow id"].
Ifresult is empty, returnerror witherror codeno such element. Otherwise, return the first element ofresult.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/shadow/{shadow id}/elements |
Theremote end steps, givensession,URLvariables andparameters are:
Letlocation strategy be the result ofgetting a property called "using".
Iflocation strategy is not present as a keyword in thetable of location strategies, returnerror witherror codeinvalid argument.
Letselector be the result ofgetting a property called "value".
Ifselector isundefined, returnerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Handle any user prompts and return its value if it is anerror.
Letstart node be the result oftrying toget a known shadow root withsession andURL variables["shadow id"].
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/active |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letactive element be theactive element ofsession'scurrent browsing context'sdocument element.
Ifactive element is a non-nullelement, returnsuccess with data set toweb element reference object forsession andactive element.
Otherwise, returnerror witherror codeno such element.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/shadow |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Handle any user prompts and return its value if it is anerror.
Letelement be the result oftrying toget a known element withsession andURL variables[element id].
Letshadow root beelement'sshadow root.
Ifshadow root is null, returnerror witherror codeno such shadow root.
Letserialized be theshadow root reference object forsession andshadow root.
Returnsuccess with dataserialized.
Tocalculate the absolute positiongivensession andelement:
Letrect be the value returned by callinggetBoundingClientRect().
Letwindow be theassociated window ofsession'scurrent top-level browsing context.
Letx be (scrollX ofwindow +rect'sx coordinate).
Lety be (scrollY ofwindow +rect'sy coordinate).
Return a pair of (x,y).
To determine ifnode isnot in the same tree as anothernode,other, run the following substeps:
If thenode'snode document is notother'snode document, return true.
Return true if the result of calling thenode'scompareDocumentPosition() withother as argument isDOCUMENT_POSITION_DISCONNECTED (1), otherwise return false.
Anelement'scontainer is:
option element in a validelement contextoptgroup element in a validelement contextTheelement'selement context, which is determined by:
Letdatalist parent be the firstdatalist element reached by traversing the tree in reverse order fromelement, orundefined if the root of the tree is reached.
Letselect parent be the firstselect element reached by traversing the tree in reverse order fromelement, orundefined if the root of the tree is reached.
Ifdatalist parent isundefined, theelement context isselect parent. Otherwise, theelement context isdatalist parent.
option element in an invalidelement contextThe element does not have a container.
The container is theelement itself.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/selected |
TheIs Element Selectedcommanddetermines if the referencedelement is selected or not.This operation only makes sense oninput elementsof theCheckbox- andRadio Button states,or onoption elements.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables[element id].
Letselected be the value corresponding to the first matching statement:
input element with atype attribute in theCheckbox- orRadio Button stateThe result ofelement'scheckedness.
option elementThe result ofelement'sselectedness.
Returnsuccess with dataselected.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/attribute/{name} |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables' element id.
Letname beURL variables["name"].
"true" (string) if theelementhasAttribute() withname, otherwisenull.
The result ofgetting an attribute by namename.
Returnsuccess with dataresult.
Please note that the behavior of this command deviates from the behavior ofgetAttribute() in [DOM], which in the case of a setboolean attribute would return an empty string. The reason this command returns true as a string is because this evaluates to true in most dynamically typed programming languages, but still preserves the expected type information.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/property/{name} |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables' element id.
LetnameURL variables["name"].
Letproperty be the result of calling theObject.[[GetProperty]](name) onelement.
Returnsuccess with dataresult.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/css/{property name} |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withURL variables["element id"].
Letcomputed value be the result of the first matching condition:
xml"property name"] fromelement's style declarations.| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/text |
TheGet Element Textcommandintends to return anelement's text “as rendered”.Anelement's rendered text is also usedfor locatinga elementsby theirlink text andpartial link text.
One of the major inputs to this specificationwas the open sourceSelenium project.This was in wide-spread use before this specification written,and so had set user expectationsof how theGet Element Text command should work.As such, the approach presented here is known to be flawed,but provides the best compatibility with existing users.
When processing text,whitespace is defined as characters from the Unicode Character Databasewith theUnicode character property "WSpace=Y" or "WS".[UAX44]
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables[element id].
Letrendered text be the result of performing implementation-specific steps whose result is exactly the same as the result of aFunction.[[Call]](null,element) withbot.dom.getVisibleText as the this value.
Returnsuccess with datarendered text.
| Chrome | 65+ |
| Chrome Android | No |
| Edge | ? |
| Edge Mobile | ? |
| Firefox | 55+ |
| Firefox Android | No |
| Opera | No |
| Opera Android | ? |
| Safari | No |
| Safari iOS | ? |
| Samsung Internet | No |
| WebView Android | ? |
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/name |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withURL variables["element id"].
Letqualified name be the result of gettingelement'stagName IDL attribute.
Returnsuccess with dataqualified name.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/rect |
TheGet Element Rectcommandreturns the dimensions and coordinates of the givenweb element.The returned value is an object with the following properties:
x"y"height"width"Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables["element id"].
Letcoordinates becalculate the absolute position withsession andelement.
Letrect beelement'sbounding rectangle.
Letbody be a new JSONObject initialized with:
x"y"width"height"Returnsuccess with databody.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/enabled |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables[element id].
Letenabled be a boolean initially set to true ifsession'scurrent browsing context'sactive document'stype is not "xml".
Otherwise, letenabled to false and jump to the last step of this algorithm.
Setenabled to false if a form control isdisabled.
Returnsuccess with dataenabled.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/computedrole |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withURL variables["element id"].
Letrole be the result of computing theWAI-ARIA role ofelement.
Returnsuccess with datarole.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/computedlabel |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables["element id"].
Letlabel be the result of aAccessible Name and Description Computation for theAccessible Name of theelement.
Returnsuccess with datalabel.
Theelement interactioncommands provide a high-level instruction set for manipulating form controls. UnlikeActions, they will implicitlyscroll elements into view and check that it is aninteractable element.
Someresettable elements define their ownclear algorithm. Unlike their associatedreset algorithms, changes made to form controls as part of these algorithmsdo count as changes caused by the user (and thus, e.g. do causeinput events to fire). When theclear algorithm is invoked for an element that does not define its ownclear algorithm, itsreset algorithm must be invoked instead.
Theclear algorithm forinput elements is to set thedirty value flag anddirty checkedness flag back to false, set thevalue of the element to an empty string, set thecheckedness of the element to true if the element has achecked content attribute and false if it does not, empty the list ofselected files, and then invoke thevalue sanitization algorithm iff thetype attribute's current state defines one.
Theclear algorithm fortextarea elements is to set thedirty value flag back to false, and set theraw value of element to an empty string.
Theclear algorithm foroutput elements is set the element'svalue mode flag to default and then to set the element'stextContent IDL attribute to an empty string (thus clearing the element's child nodes).
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/element/{element id}/click |
TheElement Clickcommandscrolls into view theelementif it is not alreadypointer-interactable,and clicks itsin-view center point.
If the element'scenter pointisobscured by another element,anelement click interceptederror is returned.If the element is outside theviewport,anelement not interactableerror is returned.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andelement id.
If theelement is aninput element in thefile upload state returnerror witherror codeinvalid argument.
Scroll into view theelement'scontainer.
Ifelement'scontainer is still notin view, returnerror witherror codeelement not interactable.
Ifelement'scontainer isobscured by anotherelement, returnerror witherror codeelement click intercepted.
Matching onelement:
option elementLetparent node be theelement'scontainer.
Fire amouseOver event atparent node.
Fire amouseMove event atparent node.
Fire amouseDown event atparent node.
Run thefocusing steps onparent node.
Ifelement is notdisabled:
Letprevious selectedness be equal toelementselectedness.
Ifelement'scontainer has themultiple attribute, toggle theelement'sselectedness state by setting it to the opposite value of its currentselectedness.
Otherwise, set theelement'sselectedness state to true.
Ifprevious selectedness is false,fire achange event atparent node.
Fire amouseUp event atparent node.
Fire aclick event atparent node.
Letinput state be the result ofget the input state givensession andsession'scurrent top-level browsing context.
Letactions options be a newactions options with theis element origin steps set torepresents a web element, and theget element origin steps set toget a WebElement origin.
Letinput id be a the result ofgenerating a UUID.
Letsource be the result ofcreate an input source withinput state, and "pointer".
Add an input source withinput state,input id andsource.
Letclick point be theelement'sin-view center point.
Letpointer move action be anaction object constructed with argumentsinput id, "pointer", and "pointerMove".
Set a propertyx to0 onpointer move action.
Set a propertyy to0 onpointer move action.
Set a propertyorigin toelement onpointer move action.
Letpointer down action be anaction object constructed with argumentsinput id, "pointer", and "pointerDown".
Set a propertybutton to0 onpointer down action.
Letpointer up action be anaction object constructed with argumentsinput id, "pointer", and "pointerUp" as arguments.
Set a propertybutton to0 onpointer up action.
Letactions be the list «pointer move action,pointer down action,pointer up action».
Dispatch a list of actions withinput state,actions,session'scurrent browsing context, andactions options.
Remove an input source withinput state andinput id.
Wait until the user agent event loop has spun enough times to process the DOM events generated by the previous step.
Perform implementation-defined steps to allow anynavigations triggered by the click to start.
It is not always clear how long this will cause the algorithm to wait, and it is acknowledged that some implementations may have unavoidable race conditions. The intention is to allow a new attempt tonavigate to begin so that the next step in the algorithm is meaningful. It is possible the click does not cause an attempt tonavigate, in which case the implementation-defined steps can return immediately, and the next step will also return immediately.
Try towait for navigation to complete withsession.
Try to run thepost-navigation checks.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/element/{element id}/clear |
Toclear a content editable element:
Ifelement'sinnerHTML IDL attribute is an empty string do nothing and return.
Run thefocusing steps forelement.
Setelement'sinnerHTML IDL attribute to an empty string.
Run theunfocusing steps for theelement.
Toclear a resettable element:
Letempty be the result of the first matching condition:
input element whosetype attribute is in theFile Upload stateIfelement is acandidate for constraint validation itsatisfies its constraints, andempty is true, abort these substeps.
Invoke thefocusing steps forelement.
Invoke theclear algorithm forelement.
Invoke theunfocusing steps for theelement.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andelement id.
Ifelement is noteditable, return anerror witherror codeinvalid element state.
Scroll into view theelement.
Lettimeout besession'ssession timeouts'implicit wait timeout.
Lettimer be a newtimer.
Iftimeout is not null:
Start the timer withtimer andtimeout.
Wait forelement to becomeinteractable, ortimer'stimeout fired flag to be set, whichever occurs first.
Ifelement is notinteractable, returnerror witherror codeelement not interactable.
Run the substeps of the first matching statement:
Invoke the steps toclear a resettable element.
Invoke the steps toclear a content editable element.
Returnerror witherror codeinvalid element state.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/element/{element id}/value |
TheElement Send Keyscommandscrolls into view the form controlelementand then sends the provided keys to theelement.In case theelement is notkeyboard-interactable,anelement not interactableerror is returned.
Anon-typeable form controlis aninput elementwhosetype attribute statecauses the primary input mechanismnot to be through means of a keyboard, whether virtual or physical.
Non-typeable form controls means to refer toform control elements rendered by the user agentas something other than as a text input control.When targetting aninput elementin thecolor statebeing presented as a color wheel,interaction with it will be simulated,rather than typed using key emulation withactions.
Other examples ofnon-typeable form controls includeform controls interacted with via system-native widgets,such as a scrolled option list forselect elementsand a number keypad forinput elementsin thenumber state on non-desktop devices.
Thekey input source used for input may be cleared mid-way through “typing” by sending thenull key, which is U+E000 (NULL).
Toclear the modifier key state giveninput state,input id,source,undo actions, andbrowsing context:
Ifsource is not akey input source returnerror witherror codeinvalid argument.
Letactions options be a newactions options with theis element origin steps set torepresents a web element, and theget element origin steps set toget a WebElement origin.
For eachentry key in the lexically sorted keys ofundo actions:
Letaction be the value ofundo actions equal to the keyentry key.
Ifaction is not anaction object with type "key" and subtype "keyUp", returnerror witherror codeinvalid argument.
Letactions be the list «action»
Dispatch a list of actions withinput state,actions,browsing context, andactions options.
Anextended grapheme cluster istypeable if it consists of a singleunicode code point and thecode is notundefined.
Theshifted state forkeyboard is the value ofkeyboard'sshift property.
Todispatch the events for a typeable stringgiveninput state,input id,source,text, andbrowsing context:
Letactions options be a newactions options with theis element origin steps set torepresents a web element, and theget element origin steps set toget a WebElement origin.
Letglobal key state be the result ofget the global key state withinput state.
Ifchar is ashifted character, and theshifted state ofsource is false:
Letaction be anaction object constructed withinput id, "key", and "keyDown", and set itsvalue property to U+E008 ("left shift").
Letactions be the list «action».
Dispatch a list of actions withinput state,actions, andbrowsing context.
Ifchar is not ashifted character and theshifted state ofsource is true:
Letaction be anaction object constructed withinput id, "key", and "keyUp", and set itsvalue property to U+E008 ("left shift").
Lettick actions be the list «action».
Dispatch a list of actions withinput state,actions,browsing context, andactions options.
Letkeydown action be anaction object constructed with argumentsinput id, "key", and "keyDown".
Set thevalue property ofkeydown action tochar.
Letkeyup action be a copy ofkeydown action with the subtype property changed to "keyUp".
Letactions be the list «keydown action,keyup action».
Dispatch a list of actions withinput state,actions,browsing context, andactions options.
When required todispatch a composition eventgiventype andcluster, andbrowsingcontext, theremote end mustperformimplementation-specific action dispatch steps onbrowsingcontext equivalent to sending composition events in accordancewith the requirements of [UI-EVENTS], and producing the followingevent with the specified properties.
composition event with properties:| Attribute | Value |
|---|---|
type | type |
data | cluster |
Todispatch actions for a string giveninputstate,input id,source,text,browsing context, andactions options:
Letclusters be an array created bybreakingtext into extended grapheme clusters.
Letundo actions be an empty map.
Letcurrent typeable text be an empty list.
For eachcluster corresponding to an indexed property inclusters run the substeps of the first matching statement:
Dispatch the events for a typeable string withinput state,input id,source,current typeable text, andbrowsing context. Emptycurrent typeable text.
Try toclear the modifier key state withinput state,input id,source,undo actions andbrowsing context.
Clearundo actions.
Dispatch the events for a typeable string withinput state,input id,source,current typeable text, andbrowsing context.
Emptycurrent typeable text.
Letkeydown action be anaction object constructed with argumentsinput id, "key", and "keyDown".
Set thevalue property ofkeydown action tocluster.
Letactions be the list «keydown action»
Dispatch a list of actions withinput state,actions,browsing context, andactions options.
Add an entry toundo actions with keycluster and value being a copy ofkeydown action with the subtype property modified to "keyUp".
Appendcluster tocurrent typeable text.
Dispatch the events for a typeable string withinput state,input id,source,current typeable text, andbrowsing context.
Emptycurrent typeable text.
Dispatch acomposition event with arguments "compositionstart",undefined, andbrowsing context.
Dispatch acomposition event with arguments "compositionupdate",cluster, andbrowsing context.
Dispatch acomposition event with arguments "compositionend",cluster, andbrowsing context.
Dispatch the events for a typeable string withinput state,input id andsource,current typeable text, andbrowsing context.
Try toclear the modifier key state withinput state,input id,source,undo actions, andbrowsing context.
Theremote end steps, givensession,URLvariables andparameters are:
Lettext be the result ofgetting a property named "text" fromparameters.
Iftext is not aString, return anerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables[element id].
Letfile be true ifelement isinput element in thefile upload state, or false otherwise.
Iffile is false or thesession'sstrict file interactability, is true run the following substeps:
Scroll into view theelement.
Lettimeout besession'ssession timeouts'implicit wait timeout.
Lettimer be a newtimer.
Iftimeout is not null:
Start the timer withtimer andtimeout.
Wait forelement to becomekeyboard-interactable, ortimer'stimeout fired flag to be set, whichever occurs first.
Ifelement is notkeyboard-interactable, returnerror witherror codeelement not interactable.
Ifelement is not theactive element run thefocusing steps for theelement.
Run the substeps of the first matching condition:
Letfiles be the result of splittingtext on the newline (\n) character.
Iffiles is of 0 length, return anerror witherror codeinvalid argument.
Letmultiple equal the result of callinghasAttribute() with "multiple" onelement.
ifmultiple isfalse and the length offiles is not equal to 1, return anerror witherror codeinvalid argument.
Verify that each file given by the user exists. If any do not, returnerror witherror codeinvalid argument.
Complete implementation specific steps equivalent to setting theselected files on theinput element. Ifmultiple istruefiles are be appended toelement'sselected files.
Fire these events in order onelement:
Ifelement does not have anown property namedvalue return anerror witherror codeelement not interactable
Ifelement is notmutable return anerror witherror codeelement not interactable.
Set a propertyvalue totext onelement.
Ifelement issuffering from bad input return anerror witherror codeinvalid argument.
Ifelement does not currently have focus, letcurrent text length be thelength ofelement'sAPI value.
Set the text insertion caret usingset selection range usingcurrent text length for both thestart andend parameters.
Letinput state be the result ofget the input state withsession andsession'scurrent top-level browsing context.
Letinput id be a the result ofgenerating a UUID.
Letsource be the result ofcreate an input source withinput state, and "key".
Add an input source withinput state,input id andsource.
Dispatch actions for a string with argumentsinput state,input id, andsource,text, andsession'scurrent browsingcontext.
Remove an input source withinput state andinput id.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/source |
TheGet Page Sourcecommand returns a stringserialization of the DOM ofsession'scurrent browsingcontextactive document.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letsource be the result of invoking thefragment serializing algorithm on a fictional node whose only child is thedocument element providingtrue for therequire well-formed flag. If this causes an exception to be thrown, letsource benull.
Letsource be the result ofserializing to stringsession'scurrent browsing context'sactive document, ifsource isnull.
Returnsuccess with datasource.
Acollection is anObjectthat implements theIterable interface,and whose:
toStringown property is "Arguments"ArrayDOMTokenListFileListHTMLAllCollectionHTMLCollectionHTMLFormControlsCollectionHTMLOptionsCollectionNodeListToJSON deserializegivensession,value and optionalargumentseen, aremote end must run the followingsteps:
Ifseen is not provided, letseen be an emptyList.
Jump to the first appropriate step below:
Matching onvalue:
nullReturnsuccess with datavalue.
Return thedeserializedweb element ofvalue.
Return thedeserializedshadow root ofvalue.
Return thedeserializedweb frame ofvalue.
Return thedeserializedweb window ofvalue.
Returnclone an object algorithm withsession,value andseen, and theJSON deserialize algorithm as the clone algorithm.
ToJSON clone givensession andvalue, return the result ofinternal JSON clone withsession,value and an emptyList.
Tointernal JSON clone givensession,value andseen, return the value of the first matching statement, matching onvalue:
nullReturnsuccess with datavalue.
ElementIf theelementis stale, returnerror witherror codestale element reference.
Otherwise:
Letreference be theweb element reference object forsession andvalue.
Returnsuccess with datareference.
ShadowRootIf theshadow rootis detached, returnerror witherror codedetached shadow root.
Otherwise:
Letreference be theshadow root reference object forsession andvalue.
Returnsuccess with datareference.
WindowProxy objectIf the associatedbrowsing context of theWindowProxy object invalue has been destroyed, returnerror witherror codestale element reference.
Otherwise:
Letreference be theWindowProxy reference object forvalue.
Returnsuccess with datareference.
toJSON" that is aFunctiontoJSON) withvalue as the this value.Letresult beclone an object withsessionvalue andseen, andinternal JSON clone as theclone algorithm.
Toclone an object, givensession,value,seen, andclone algorithm:
Ifvalue is inseen, returnerror witherror codejavascript error.
Appendvalue toseen.
Letresult be the value of the first matching statement, matching onvalue:
A newArray whichlength property is equal to the result ofgetting the propertylength ofvalue.
A newObject.
For each enumerable property invalue, run the following substeps:
Letname be the name of the property.
Letsource property value be the result ofgetting a property namedname fromvalue. If doing so causes script to be run and that script throws an error, returnerror witherror codejavascript error.
Letcloned property result be the result of calling theclone algorithm withsession,source property value andseen.
Ifcloned property result is asuccess,set a property ofresult with namename and value equal tocloned property result's data.
Otherwise, returncloned property result.
Remove the last element ofseen.
When required toextract the script arguments from a request with argumentparameters the implementation must:
Letscript be the result ofgetting a property named "script" fromparameters.
Ifscript is not aString, returnerror witherror codeinvalid argument.
Letargs be the result ofgetting a property named "args" fromparameters.
Ifargs is not anArray returnerror witherror codeinvalid argument.
Letarguments beJSON deserialize withsession andargs.
Returnsuccess with datascript andarguments.
The rules toexecute a function body are as follows. The algorithm returnsan ECMAScript completion record.
If at any point during the algorithm auser prompt appears, immediately returnCompletion { [[Type]]:normal, [[Value]]:null, [[Target]]:empty }, but continue to run the other steps of this algorithmin parallel.
Letwindow be theassociated window ofsession'scurrent browsing context'sactive document.
Letenvironment settings bewindow'srelevant settings object.
Ifbody is not parsable as aFunctionBody or if parsing detects anearly error, returnCompletion { [[Type]]:normal, [[Value]]:null, [[Target]]:empty }.
Ifbody begins with adirective prologue that contains ause strict directive then letstrict be true, otherwise letstrict be false.
Prepare to run script withenvironment settings.
Prepare to run a callback withenvironment settings.
Letfunction be the result of callingFunctionCreate, with arguments:
Letcompletion beFunction.[[Call]](window,parameters) withfunction as the this value.
Clean up after running a callback withenvironment settings.
Clean up after running script withenvironment settings.
Returncompletion.
The above algorithm is not associated with any particular element, and is therefore not subject to the document CSPdirectives.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/execute/sync |
Theremote end steps, givensession,URLvariables andparameters are:
Letbody andarguments be the result oftrying toextract the script arguments from a request with argumentparameters.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Lettimeout besession'ssession timeouts'script timeout.
Lettimer be a newtimer.
Iftimeout is not null:
Start the timer withtimer andtimeout.
Letpromise bea new Promise.
Run the following substepsin parallel:
LetscriptPromise be the result ofpromise-callingexecute a function body, with argumentsbody andarguments.
Upon fulfillment ofscriptPromise with valuev,resolvepromise with valuev.
Upon rejection ofscriptPromise with valuer,rejectpromise with valuer.
Wait untilpromise is resolved, ortimer'stimeout fired flag is set, whichever occurs first.
Ifpromise is still pending andtimer'stimeout fired flag is set, returnerror witherror codescript timeout.
Ifpromise is fulfilled with valuev, letresult beJSON clone withsession andv, and returnsuccess with dataresult.
Ifpromise is rejected with reasonr, letresult beJSON clone withsession andr, and returnerror witherror codejavascript error and dataresult.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/execute/async |
TheExecute Async Scriptcommandcauses JavaScript to execute as an anonymous function.An additional value is provided as the final argument to the function.This is a function that may be invoked to signal the completion of the asynchronous operation.The first argument provided to the function will be serialized to JSON and returned byExecute Async Script.
Theremote end steps, givensession,URLvariables andparameters are:
Letbody andarguments by the result oftrying toextract the script arguments from a request with argumentparameters.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Lettimeout besession'ssession timeouts'script timeout.
Lettimer be a newtimer.
Iftimeout is not null:
Start the timer withtimer andtimeout.
Letpromise bea new Promise.
Run the following substepsin parallel:
LetresolvingFunctions beCreateResolvingFunctions(promise).
AppendresolvingFunctions.[[Resolve]] toarguments.
LetscriptResult be the result of callingexecute a function body, with argumentsbody andarguments.
IfscriptResult.[[Type]] is notnormal, thenrejectpromise with valuescriptResult.[[Value]], and abort these steps.
Prior revisions of this specification did not recognize the return value of the provided script. In order to preserve legacy behavior, the return value only influences the command if it is a "thenable" object or if determining this produces an exception.
IfType(scriptResult.[[Value]]) is notObject, then abort these steps.
Letthen beGet(scriptResult.[[Value]], "then").
Ifthen.[[Type]] is notnormal, thenrejectpromise with valuethen.[[Value]], and abort these steps.
IfIsCallable(then.[[Type]]) isfalse, then abort these steps.
LetscriptPromise bePromiseResolve(Promise,scriptResult.[[Value]]).
Upon fulfillment ofscriptPromise with valuev,resolvepromise with valuev.
Upon rejection ofscriptPromise with valuer,rejectpromise with valuer.
Wait untilpromise is resolved, ortimer'stimeout fired flag is set, whichever occurs first.
Ifpromise is still pending andtimer'stimeout fired flag is set, returnerror witherror codescript timeout.
Ifpromise is fulfilled with valuev, letresult beJSON clone withsession andv, and returnsuccess with dataresult.
Ifpromise is rejected with reasonr, letresult beJSON clone withsession andr, and returnerror witherror codejavascript error and dataresult.
This section describes the interaction withcookies as described in [RFC6265].
Acookie is described in [RFC6265] by a name-value pair holding the cookie's data, followed by zero or more attribute-value pairs describing its characteristics.
The followingtable for cookie conversion defines the cookie concepts relevant to WebDriver, how these are referred to in [RFC6265], what keys they map to in aserialized cookie, as well as the attribute-value keys needed when constructing a list of arguments forcreating a cookie.
For informational purposes, the table includes a legend of whether the field is optional in theserialized cookie provided toAdd Cookie, and a brief non-normative description of the field and the expected input type of its associated value.
| Concept | RFC 6265 Field | JSON Key | Attribute Key | Optional | Description |
|---|---|---|---|---|---|
| Cookie name | name | "name" | The name of the cookie. | ||
| Cookie value | value | "value" | The cookie value. | ||
| Cookie path | path | "path" | "Path" | ✓ | The cookie path. Defaults to "/" if omitted whenadding a cookie. |
| Cookie domain | domain | "domain" | "Domain" | ✓ | The domain the cookie is visible to. Defaults tosession'scurrent browsing context'sactive document'sURLdomain if omitted whenadding a cookie. |
| Cookie secure only | secure-only-flag | "secure" | "Secure" | ✓ | Whether the cookie is a secure cookie. Defaults to false if omitted whenadding a cookie. |
| Cookie HTTP only | http-only-flag | "httpOnly" | "HttpOnly" | ✓ | Whether the cookie is an HTTP only cookie. Defaults to false if omitted whenadding a cookie. |
| Cookie expiry time | expiry-time | "expiry" | "Max-Age" | ✓ | When the cookie expires, specified in seconds sinceUnix Epoch. Must not be set if omitted whenadding a cookie. |
| Cookie same site | samesite | "sameSite" | "SameSite" | ✓ | Whether the cookie applies to a SameSite policy. Defaults to None if omitted whenadding a cookie. Can be set to eitherLax orStrict. |
Aserialized cookie is a JSONObject where acookie's [RFC6265] fields listed in thetable for cookie conversion are mapped using theJSON Key and the associated field's value from thecookie store. The optional fields may be omitted.
To getall associated cookies to adocument, the user agent must return the enumerated set ofcookies that meet the requirements set out in the first step of the algorithm in [RFC6265] tocomputecookie-string for an ‘HTTP API', from thecookie store of the givendocument'saddress. The returned cookies must includeHttpOnly cookies.
When theremote end is instructed tocreate a cookie, this is synonymous to carrying out the steps described in [RFC6265]section 5.3, underreceiving a cookie, except the user agent may not ignore the received cookie in its entirety (disregard step 1).
Todelete cookies given an optional filter argumentname that is a string:
For eachcookie amongall associated cookies ofsession'scurrent browsing context'sactive document, run the substeps of the first matching condition:
Set thecookie expiry time to aUnix timestamp in the past.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/cookie |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letcookies be a newList.
For eachcookie inall associated cookies ofsession'scurrent browsing context'sactive document:
Letserialized cookie be the result ofserializingcookie.
Appendserialized cookie tocookies
Returnsuccess with datacookies.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/cookie/{name} |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
If theURL variables["name" is equal to acookie'scookie name amongstall associated cookies ofsession'scurrent browsing context'sactive document, returnsuccess with theserialized cookie as data.
Otherwise, returnerror witherror codeno such cookie.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/cookie |
Theremote end steps, givensession,URLvariables andparameters are:
Letdata be the result ofgetting a property named "cookie" fromparameters.
Ifdata is not a JSONObject with all the required (non-optional) JSON keys listed in thetable for cookie conversion, returnerror witherror codeinvalid argument.
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Ifsession'scurrent browsing context'sdocument element is acookie-averseDocument object, returnerror witherror codeinvalid cookie domain.
Ifcookie name orcookie value isnull,cookie domain is not equal tosession'scurrent browsing context'sactive document'sdomain,cookie secure only orcookie HTTP only are not boolean types, orcookie expiry time is not an integer type, or it less than 0 or greater than themaximum safe integer, returnerror witherror codeinvalid argument.
Create a cookie in thecookie store associated with theactive document'saddress usingcookie namename,cookie valuevalue, and an attribute-value list of the following cookie concepts listed in thetable for cookie conversion fromdata:
The value if the entry exists, otherwise "/".
The value if the entry exists, otherwisesession'scurrent browsing context'sactive document'sURLdomain.
The value if the entry exists, otherwise false.
The value if the entry exists, otherwise false.
The value if the entry exists, otherwise leave unset to indicate that this is a session cookie.
The value if the entry exists, otherwise leave unset to indicate that no same site policy is defined.
If there is anerror during this step, returnerror witherror codeunable to set cookie.
| HTTP Method | URI Template |
|---|---|
| DELETE | /session/{session id}/cookie/{name} |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Delete cookies using theURL variables["name"] as the filter argument.
| HTTP Method | URI Template |
|---|---|
| DELETE | /session/{session id}/cookie |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Delete cookies, giving no filtering argument.
The Actions API provides a low-level interface for providing virtualized device input to the web browser. Conceptually, the Actions commands divide time into a series ofticks. Thelocal end sends a series of actions which correspond to the change in state, if any, of each input device during eachtick. For example, pressing a key is represented by an action sequence consisting of a single key input device and twoticks, the first containing akeyDown action, and the second akeyUp action, whereas a pinch-zoom input is represented by an action sequence consisting of threeticks and two pointer input devices of type touch, each performing a sequence of actionspointerDown, followed bypointerMove, and thenpointerUp.
Imagine we have two fingers acting on a touchscreen. One finger will press down on element1 at the same moment that another finger presses down on element2. Once these actions are done, the first finger will wait 5 seconds while the other finger moves to element3. Then both fingers release from the touchscreen.
When theremote end receives this, it will look at eachinput source's action lists. It will dispatch the first action of each source together, then the second actions together, and lastly, the final actions together.
The diagram below displays when each action gets executed. "Source 1" is the first finger, and "source 2" is the second.
There is no limit to the number ofinput sources, and there is no restriction regarding the length of each input's action list. This means, there is no requirement that all action lists have to be the same length. It is possible for oneinput source's action list may have more actions than another.
In this case, the action list for the first finger contains 2 actions (pointerDown,pointerUp), and the action list for the second finger contains 3 (pointerDown,pointerMove,pointerUp).
And the execution of each action will be done as follows:
Specific timing for the actions can also be expressed. Thepause action can be used to either (a) indicate a specific amount of time aninput source must wait, or (b) can be used to signify that the currentinput source must wait until all other actions in thetick are completed. For the former case, the currenttick being executed must wait for the longest pause to complete. For example, in this diagram:
Theremote end will dispatch thepointerDown action in the firsttick. In the secondtick, since source 1 declares apause of 5 seconds, theremote end will dispatch thepointerUp event for source 2, and will wait 5 seconds before moving on to executing the thirdtick.
In the event that onetick contains multiplepause durations, theremote end will wait the maximum duration before moving on to executing the nexttick.
As noted before,pause can be used to signify inaction during atick. Ifpause is declared without a time period, then theinput source will not have any actions executed in the containingtick. As an example:
Duringtick 2, source 1 will have itspointerMove action dispatched, while source 2 will do nothing.
Configuration of actions dispatch is controlled by aactions options object. This is astruct that has afields namedis element origin, which is a set of stepsthat validate if a protocol object represents an element origin,andget element origin, which is a set of stepsused to deserialize an element.
Toget a WebElement origingivensession,origin andbrowsingcontext:,
Assert:browsing context is thecurrent browsing context.
Letelement be equal to the result oftrying toget a known element withsession andorigin.
Returnsuccess with dataelement.
Aninput source is a virtual device providing input events. Each input source is represented by anstruct specific to the type of the input source. Each input source has aninput id which is stored as a key in theinput state map.
Tocreate an input source giveninputstate,type and optionalsubtype:
Run the substeps matching the first matching value oftype:
none"key"pointer"wheel"Anull input source is aninput source that is not associated with a specific physical device. anull input source has no type-specific items, and supports the following actions:
| Action | Non-normative Description |
|---|---|
| pause | Used with an integer argument to specify the duration of atick, or as a placeholder to indicate that aninput source does nothing during a particulartick. |
Tocreate a null input source, return a newnull inputsource.
Akey input source is aninput source that is associated with a keyboard-type device.
Akey input source has the following items:
| Item | Non-normative Description | Default Value |
|---|---|---|
| pressed | A set of strings representing currently pressed keys. | Empty set |
| alt | A boolean indicating whether the alt modifier is depressed. | False |
| ctrl | A boolean indicating whether the ctrl modifier is depressed. | False |
| meta | A boolean indicating whether the meta modifier is depressed. | False |
| shift | A boolean indicating whether the shift modifier is depressed. | False |
Akey input source supports the samepause actionas anull input source plus the following actions:
| Action | Non-normative Description |
|---|---|
| keyDown | Used to indicate that a particular key should be held down. |
| keyUp | Used to indicate that a depressed key should be released. |
Tocreate a key input source, return a newkeyinput source with the items initalized to their default values.
Apointer input source is aninput source that is associated with a pointer-type input device.
Apointer input source has the following items:
| Item | Non-normative Description | Default Value |
|---|---|---|
| subtype | The type of pointing device. This can be "mouse", "pen", or "touch". | |
| pointerId | The numeric id of the pointing device. This is a positive integer, with the values 0 and 1 reserved for mouse-type pointers. | |
| pressed | A set of unsigned integers representing the pointer buttons that are currently depressed. | Empty set |
| x | An unsigned integer representing the pointer x location in viewport coordinates. | 0 |
| y | An unsigned integer representing the pointer y location in viewport coordinates. | 0 |
Apointer input source supports the samepause action as anull input source plus the following actions:
| Action | Non-normative Description |
|---|---|
| pointerDown | Used to indicate that a pointer should be depressed in some way e.g. by holding a button down (for a mouse) or by coming into contact with the active surface (for a touch or pen device). |
| pointerUp | Used to indicate that a pointer should be released in some way e.g. by releasing a mouse button or moving a pen or touch device away from the active surface. |
| pointerMove | Used to indicate a location on the screen that a pointer should move to, either in its active (pressed) or inactive state. |
| pointerCancel | Used to cancel a pointer action. |
Tocreate a pointer input source object giveninput state, andsubtype, return a newpointer input source with subtype set tosubtype, pointerId set toget a pointer id withinput state andsubtype, and the other items set to their default values.
Awheel input source is aninput source that is associated with a wheel-type input device. Awheel input source has no type specific items, and supports the samepause action as anull input source plus the following actions:
| Action | Non-normative Description |
|---|---|
| scroll | Used to indicate that the scroll wheel is rolled down, up, right or left to scroll the page down, up, right or left. |
Tocreate a wheel input source return a newwheel input source.
Aninput state represents the overall state of acollection ofinput sources.Aninput state has the following items:
Ainput state map which is a map where keys areinput ids, and the values areinput sources.
Aninput cancel list, which is a list ofaction objects. This list is used to manage dispatching events when resetting the state of theinput source
Anactions queue which is aqueue that ensures that access to theinput state is serialized.
Toget the input state givensessionandbrowsing context:
Assert:browsing context is atop-level browsing context.
Letinput state map besession'sbrowsing context input state map.
Ifinput state map does notcontainbrowsing context, setinput state map[browsing context] tocreate an input state.
Returninput state map[browsing context].
Toreset the input state givensessionandbrowsing context:
Assert:browsing context is atop-level browsing context.
Letinput state map besession'sbrowsing context input state map.
Ifinput state map[browsing context]exists, thenremoveinput state map[browsing context].
Tocreate an input state:
Letinput state be aninput state with theinput state map set to an empty map, and theinput cancel list set to an empty list.
Returninput state.
Toadd an input source giveninput state,input id, andsource:
Letinput state map beinput state'sinput state map.
Toremove an input source giveninput state,andinput id:
Assert: None of the items ininput state'sinput cancel list has id equal toinput id.
Letinput state map beinput state'sinput state map.
Toget an input source giveninput stateandinput id:
Letinput state map beinput state'sinput state map.
Ifinput state map[input id] exists, returninput state map[input id].
Return undefined.
Toget or create an input source giveninputstate,type,input id, andoptionalsubtype:
Letsource beget an input source withinput state andinput id.
Ifsource is not undefined andsource's type is not equal totype, orsource is apointer input source, returnerror witherror codeinvalid argument.
Ifsource is undefined, setsource to the result oftrying tocreate an input source withinput state andtype.
Return success with datasource.
Aglobal key state is astruct with items pressed,altKey, ctrlKey, metaKey, and shiftKey.
Toget the global key state giveninput state:
Letinput state map beinput state'sinput state map.
Letsources be the result ofgetting the values withinput state map.
Letkey state be a newglobal key state withpressed set to an empty set,altKey,ctrlKey,metaKey, andshiftKey set to false.
For eachsource insources:
Ifsource is not akey input source, continue to the first step of this loop.
Setkey state'spressed item to the union of its current value andsource's pressed item.
Ifsource'salt item is true, setkey state'saltKey item to true.
Ifsource'sctrl item is true, setkey state'sctrlKey item to true.
Ifsource'smeta item is true, setkey state'smetaKey item to true.
Ifsource'sshift item is true, setkey state'sshiftKey item to true.
Returnkey state.
Toget a pointer id giveninput stateandsubtype:
mouse", or 2 otherwise.Letsources be the result ofgetting the values withinput state'sinput state map.
For eachsource insources.:
Ifsource is apointer input source, appendsource's pointerId topointer ids.
Return the smallest integer that is greater than or equal tominimum id and that is not contained inpointer ids.
Atick is the basic unit of time over which actions can be performed. During atick, eachinput source has an assigned action — possibly a nooppause action — which may result in changes to the user agent internal state and eventually cause DOM events to befired at the page. The nexttick begins after the user agent has had a chance to process all DOM events generated in the currenttick.
Waiting asynchronously means waiting for something to occur whilst allowing the browser to continue processing theevent loop.
At the lowest level, the behavior of actions is intended to mimic theremote end's behavior with an actual input device as closely as possible, and the implementation strategy may involve e.g. injecting synthesized events into a browser event loop. Therefore the steps to dispatch an action will inevitably end up in implementation-specific territory. However there are certain content observable effects that must be consistent across implementations. To accommodate this, the specification requires thatremote endsperform implementation-specific action dispatch steps on abrowsing contextcontext, and alist of events and their properties. These steps must be equivalent to performing the given input device manipulations oncontext, such that trusted events corresponding to the entries inlist of eventsare dispatched.
The list of events is not comprehensive; in particular the default action of theinput source may cause additional events to be generated depending on the implementation and the state of the browser (e.g. input events relating to key actions when the focus is on an editableelement, scroll events, etc.).
Anactivation trigger generated by WebDriverneeds to be indistinguishable from those generated by a real user interacting with the browser.In particular, the dispatched eventswill have theisTrusted attribute set to true.
The most robust way to dispatch these events is by creating them inthe browser implementation itself. Sending operating system specificinput messages to the browser's window has the disadvantage that thebrowser being automated may not be properly isolated from a useraccidentally modifying aninput source. Use of an operatingsystem level accessibility API has the disadvantage that the browser'swindow must be focused, and as a result, multiple WebDriver instancescannot run in parallel.
The advantage of an operating system level accessibility APIis that it guarantees that inputs correctly mirror user input,and allows interaction with the host system if necessary.This might, however, have performance penaltiesfrom a machine utilisation perspective.
The algorithm forextracting an action sequence from a request takes the JSONObject representing an action sequence, validates the input, and returns a data structure that is the transpose of the input JSON, such that the actions to be performed in a singletick are grouped together.
Toget coordinates relative to an origingivensource,x offset,y offset,origin,browsing context, andactionsoptions:
Run the substeps of the first matching value oforigin
viewport"Letx equalx offset andy equaly offset.
pointer"Letstart x be equal to thex property ofsource.
Letstart y be equal to they property ofsource.
Letx equalstart x +x offset andy equalstart y +y offset.
Letelement be the result oftrying to runactions options'get element origin steps withorigin andbrowsing context.
Ifelement is null, returnerror witherror codeno such element.
Letx element andy element be the result of calculating thein-view center point ofelement.
Letx equalx element +x offset, andy equaly element +y offset.
Return (x,y)
Toextract an action sequence giveninput state,parameters, andactions options:
Letactions be the result ofgetting a property named "actions" fromparameters.
Ifactions isundefined or is not anArray, returnerror witherror codeinvalid argument.
Letactions by tick be an emptyList.
For each valueaction sequence corresponding to an indexed property inactions:
Letsource actions be the result oftrying toprocess an input source action sequence giveninput state,action sequence, andactions options.
For eachaction insource actions:
Returnsuccess with dataactions by tick.
When required toprocess an input source action sequence, giveninput state,action sequence, andactions options, aremote end must:
Lettype be the result ofgetting a property named "type" fromaction sequence.
Iftype is not "key", "pointer", "wheel", or "none", return anerror witherror codeinvalid argument.
Letid be the result ofgetting the property "id" fromaction sequence.
Ifid isundefined or is not aString, returnerror witherror codeinvalid argument.
Iftype is equal to "pointer", letparameters data be the result ofgetting the property "parameters" fromaction sequence. Then letparameters be the result oftrying toprocess pointer parameters with argumentparameters data.
Letsource be the result of trying toget or create an input source giveninput state,type andid.
Ifparameters is notundefined, then if itspointerType property is not equal tosource's subtype property, return anerror witherror codeinvalid argument.
Letaction items be the result ofgetting a property named "actions" fromaction sequence.
Ifaction items is not anArray, returnerror witherror codeinvalid argument.
Letactions be a new list.
For eachaction item inaction items:
Ifaction item is not anObject returnerror witherror codeinvalid argument.
Iftype is "none" letaction be the result oftrying toprocess a null action with parametersid, andaction item.
Otherwise, iftype is "key" letaction be the result oftrying toprocess a key action with parametersid, andaction item.
Otherwise, iftype is "pointer" letaction be the result oftrying toprocess a pointer action with parametersid,parameters,action item, andactions options.
Otherwise, iftype is "wheel" letaction be the result oftrying toprocess a wheel action with parametersid, andaction item, andactions options.
Appendaction toactions.
Returnsuccess with dataactions.
Thedefault pointer parameters consist of an object with propertypointerType set tomouse.
Toprocess pointer parameters givenparameters data:
Letparameters be thedefault pointer parameters.
Ifparameters data isundefined,returnsuccess with dataparameters.
Ifparameters data is not anObject,returnerror witherror codeinvalid argument.
Letpointer type be the resultofgetting a property named "pointerType"fromparameters data.
Ifpointer type is notundefined:
Ifpointer type does not have one of the values "mouse", "pen", or "touch", returnerror witherror codeinvalid argument.
Set thepointerType property ofparameters topointer type.
Returnsuccess with dataparameters.
Anaction object constructed with argumentsid,type, andsubtype is an object with property id set toid, type set totype and subtype set tosubtype. Specific action objects have further properties added by other algorithms in this specification.
Toprocess a null action givenid andaction item:
Letsubtype be the result ofgetting a propertynamed "type" fromaction item.
Ifsubtype is not "pause",returnerror witherror codeinvalid argument.
Letaction be anaction object constructed with argumentsid,"none",andsubtype.
Letresult be the resultoftrying toprocess a pause actionwith argumentsaction item andaction.
Returnresult.
Toprocess a key action givenid andaction item:
Letsubtype be the result ofgetting a propertynamed "type" fromaction item.
Ifsubtype is not one of the values"keyUp","keyDown",or "pause",return anerror witherror codeinvalid argument.
Letaction be anaction object constructed with argumentsid,"key",andsubtype.
Ifsubtype is "pause",letresult be the resultoftrying toprocess a pause action with argumentsaction item andaction,and returnresult.
Letkey be the result ofgetting a propertynamed "value" fromaction item.
Ifkey is not aString containing a singleunicode code pointor grapheme cluster?returnerror witherror codeinvalid argument.
Set thevalue property onaction tokey.
Return success with dataaction.
Toprocess a pointer action givenid,parameters,action item, andactionoptions:
Letsubtype be the resultofgetting a property named "type"fromaction item.
Ifsubtype is not one of the values"pause","pointerUp","pointerDown","pointerMove",or "pointerCancel",return anerror witherror codeinvalid argument.
Letaction be anaction object constructed with argumentsid,"pointer",andsubtype.
Ifsubtype is "pause",letresult be the result oftrying toprocess a pause action with argumentsaction item,action, andactionsoptions, and returnresult.
Set thepointerType property ofactionequal to thepointerType property ofparameters.
Ifsubtype is "pointerUp" or "pointerDown",process a pointer up or pointer down action with argumentsaction item andaction.If doing so results in anerror, return thaterror.
Ifsubtype is "pointerMove"process a pointer move action with argumentsaction item,action, andactionsoptions. If doing so results in anerror, returnthaterror.
Ifsubtype is "pointerCancel"process a pointer cancel action.If doing so results in anerror, return thaterror.
Returnsuccess with dataaction.
Toprocess a wheel action givenid,action item, andactionsoptions:
Letsubtype be the resultofgetting a property named "type"fromaction item.
Ifsubtype is not the value"pause", or"scroll",return anerror witherror codeinvalid argument.
Letaction be anaction object constructed with argumentsid,"wheel",andsubtype.
Ifsubtype is "pause",letresult be the result oftrying toprocess a pause action with argumentsaction item andaction,and returnresult.
Letduration be the result ofgetting a propertynamed "duration" fromaction item.
Ifduration is notundefined anddurationis not anInteger greater than or equal to 0, returnerrorwitherror codeinvalid argument.
Set theduration property ofactiontoduration.
Letorigin be the result ofgetting the propertyorigin fromaction item.
Iforigin isundefined letorigin equal "viewport".
Iforigin is not equal to "viewport",oractions options'is element origin steps givenorigin return false, returnerror witherror codeinvalid argument.
Set theorigin property ofactiontoorigin.
Letx be the result ofgetting the propertyx fromaction item.
Ifx is not anInteger, returnerrorwitherror codeinvalid argument.
Set thex property ofaction tox.
Lety be the result ofgetting the propertyy fromaction item.
Ify is not anInteger, returnerrorwitherror codeinvalid argument.
Set they property ofaction toy.
LetdeltaX be the result ofgetting the propertydeltaX fromaction item.
IfdeltaX is not anInteger,returnerror witherror codeinvalid argument.
Set thedeltaX property ofaction todeltaX.
LetdeltaY be the result ofgetting the propertydeltaY fromaction item.
IfdeltaY is not anInteger,returnerror witherror codeinvalid argument.
Set thedeltaY property ofaction todeltaY.
Returnsuccess with dataaction.
Toprocess a pause action givenaction item,andaction:
Letduration be the result ofgetting the property "duration" fromaction item.
Ifduration is notundefined andduration is not anInteger greater than or equal to 0, returnerror witherror codeinvalid argument.
Set theduration property ofaction toduration.
Return success with dataaction.
Toprocess a pointer up or pointer down action givenaction item, andaction:
Letbutton be the result of getting the propertybutton fromaction item.
Ifbutton is not anInteger greater than or equal to 0 returnerror witherror codeinvalid argument.
Set thebutton property ofaction tobutton.
Letwidth be the result of getting the propertywidth fromaction item.
Ifwidth is notundefined andwidth is not aNumber greater than or equal to 0 returnerror witherror codeinvalid argument.
Set thewidth property ofaction towidth.
Letheight be the result of getting the propertyheight fromaction item.
Ifheight is notundefined andheight is not aNumber greater than or equal to 0 returnerror witherror codeinvalid argument.
Set theheight property ofaction toheight.
Letpressure be the result of getting the propertypressure fromaction item.
Ifpressure is notundefined andpressure is not aNumber greater than or equal to 0 and less than or equal to 1 returnerror witherror codeinvalid argument.
Set thepressure property ofaction topressure.
LettangentialPressure be the result of getting the propertytangentialPressure fromaction item.
IftangentialPressure is notundefined andtangentialPressure is not aNumber greater than or equal to -1 and less than or equal to 1 returnerror witherror codeinvalid argument.
Set thetangentialPressure property ofaction totangentialPressure.
LettiltX be the result of getting the propertytiltX fromaction item.
IftiltX is notundefined andtiltX is not anInteger greater than or equal to -90 and less than or equal to 90 returnerror witherror codeinvalid argument.
Set thetiltX property ofaction totiltX.
LettiltY be the result of getting the propertytiltY fromaction item.
IftiltY is notundefined andtiltY is not anInteger greater than or equal to -90 and less than or equal to 90 returnerror witherror codeinvalid argument.
Set thetiltY property ofaction totiltY.
Lettwist be the result of getting the propertytwist fromaction item.
Iftwist is notundefined andtwist is not anInteger greater than or equal to 0 and less than or equal to 359 returnerror witherror codeinvalid argument.
Set thetwist property ofaction totwist.
LetaltitudeAngle be the result of getting the propertyaltitudeAngle fromaction item.
IfaltitudeAngle is notundefined andaltitudeAngle is not aNumber greater than or equal to 0 and less than or equal to π/2 returnerror witherror codeinvalid argument.
Set thealtitudeAngle property ofaction toaltitudeAngle.
LetazimuthAngle be the result of getting the propertyazimuthAngle fromaction item.
IfazimuthAngle is notundefined andazimuthAngle is not aNumber greater than or equal to 0 and less than or equal to 2π returnerror witherror codeinvalid argument.
Set theazimuthAngle property ofaction toazimuthAngle.
Return success with datanull.
Toprocess a pointer move action givenactionitem,action, andactions options:
Letduration be the result of getting the propertyduration fromaction item.
Ifduration is notundefined andduration is not anInteger greater than or equal to 0, returnerror witherror codeinvalid argument.
Set theduration property ofaction toduration.
Letorigin be the result ofgetting the propertyorigin fromaction item.
Iforigin isundefined letorigin equal "viewport".
Iforigin is not equal to "viewport" or "pointer", andactions optionsis element origin steps givenorigin return false, returnerror witherror codeinvalid argument.
Set theorigin property ofaction toorigin.
Letx be the result ofgetting the propertyx fromaction item.
Ifx is not aNumber, returnerror witherror codeinvalid argument.
Set thex property ofaction tox.
Lety be the result ofgetting the propertyy fromaction item.
Ify is not aNumber, returnerror witherror codeinvalid argument.
Set they property ofaction toy.
Letwidth be the result of getting the propertywidth fromaction item.
Ifwidth is notundefined andwidth is not aNumber greater than or equal to 0 returnerror witherror codeinvalid argument.
Set thewidth property ofaction towidth.
Letheight be the result of getting the propertyheight fromaction item.
Ifheight is notundefined andheight is not aNumber greater than or equal to 0 returnerror witherror codeinvalid argument.
Set theheight property ofaction toheight.
Letpressure be the result of getting the propertypressure fromaction item.
Ifpressure is notundefined andpressure is not aNumber greater than or equal to 0 and less than or equal to 1 returnerror witherror codeinvalid argument.
Set thepressure property ofaction topressure.
LettangentialPressure be the result of getting the propertytangentialPressure fromaction item.
IftangentialPressure is notundefined andtangentialPressure is not aNumber greater than or equal to -1 and less than or equal to 1 returnerror witherror codeinvalid argument.
Set thetangentialPressure property ofaction totangentialPressure.
LettiltX be the result of getting the propertytiltX fromaction item.
IftiltX is notundefined andtiltX is not anInteger greater than or equal to -90 and less than or equal to 90 returnerror witherror codeinvalid argument.
Set thetiltX property ofaction totiltX.
LettiltY be the result of getting the propertytiltY fromaction item.
IftiltY is notundefined andtiltY is not anInteger greater than or equal to -90 and less than or equal to 90 returnerror witherror codeinvalid argument.
Set thetiltY property ofaction totiltY.
Lettwist be the result of getting the propertytwist fromaction item.
Iftwist is notundefined andtwist is not anInteger greater than or equal to 0 and less than or equal to 359 returnerror witherror codeinvalid argument.
Set thetwist property ofaction totwist.
LetaltitudeAngle be the result of getting the propertyaltitudeAngle fromaction item.
IfaltitudeAngle is notundefined andaltitudeAngle is not aNumber greater than or equal to 0 and less than or equal to π/2 returnerror witherror codeinvalid argument.
Set thealtitudeAngle property ofaction toaltitudeAngle.
LetazimuthAngle be the result of getting the propertyazimuthAngle fromaction item.
IfazimuthAngle is notundefined andazimuthAngle is not aNumber greater than or equal to 0 and less than or equal to 2π returnerror witherror codeinvalid argument.
Set theazimuthAngle property ofaction toazimuthAngle.
Return success with datanull.
The algorithm todispatch actions takes a list of actions grouped bytick, and then causes each action to be run at the appropriate point in the sequence.
Towait for an action queue token giveninput state:
Lettoken be a new unique identifier.
Enqueuetoken ininput state'sactions queue.
Wait fortoken to be the first item ininput state'sactions queue.
Todispatch actions giveninputstate,actions by tick,browsingcontext, andactions options:
Wait for an action queue token withinput state.
Letactions result be the result ofdispatch actions inner withinput state,actions by tick,browsing context, andactions options.
Dequeueinput state'sactions queue.
Assert: this returnstoken
Returnactions result.
Todispatch actions inner giveninputstate,actions by tick,browsingcontext, andactions options:
For each itemtick actions inactions by tick:
Lettick duration be the result ofcomputing the tick duration with argumenttick actions.
Try todispatch tick actions withinput state,tick actions,tick duration,browsing context, andactions options.
Wait until the following conditions are all met:
There are no pendingasynchronous waits arising from the last invocation of thedispatch tick actions steps.
The user agent event loop has spun enough times to process the DOM events generated by the last invocation of thedispatch tick actions steps.
At leasttick duration milliseconds have passed.
Return success with datanull.
Tocompute the tick duration giventick actions:
Letmax duration be 0.
For eachaction object intick actions:
letduration beundefined.
Ifaction object has subtype property set to "pause" oraction object has type property set to "pointer" and subtype property set to "pointerMove", oraction object has type property set to "wheel" and subtype property set to "scroll", letduration be equal to theduration property ofaction object.
Ifduration is notundefined, andduration is greater thanmax duration, letmax duration be equal to duration.
Returnmax duration.
Todispatch tick actions giveninput state,tick actions,tick duration,browsing context, andactions options:
For eachaction object intick actions:
Letinput id be equal to the value ofaction object's id property.
Letsource type be equal to the value ofaction object's type property.
Letsource be the result ofget an input source giveninput state andinput id.
Assert:source is not undefined.
Letglobal key state be the result ofget the global key state withinput state.
Letsubtype beaction object's subtype.
Letalgorithm be the value of the columndispatch action algorithm from the following table where thesource type column issource type and thesubtype column is equal tosubtype.
| source type | subtype | Dispatch action algorithm |
|---|---|---|
"none" | "pause" | Dispatch a pause action |
"key" | "pause" | Dispatch a pause action |
"key" | "keyDown" | Dispatch a keyDown action |
"key" | "keyUp" | Dispatch a keyUp action |
"pointer" | "pause" | Dispatch a pause action |
"pointer" | "pointerDown" | Dispatch a pointerDown action |
"pointer" | "pointerUp" | Dispatch a pointerUp action |
"pointer" | "pointerMove" | Dispatch a pointerMove action |
"pointer" | "pointerCancel" | Dispatch a pointerCancel action |
"wheel" | "pause" | Dispatch a pause action |
"wheel" | "scroll" | Dispatch a scroll action |
Ifsubtype is "keyDown", append a copy ofaction object with thesubtype property changed to "keyUp" toinput state'sinput cancel list.
Ifsubtype is "pointerDown", append a copy ofaction object with thesubtype property changed to "pointerUp" toinput state'sinput cancel list.
Todispatch a list of actions giveninputstate,actions,browsing context,andactions options:
Lettick actions be the list «actions»
Letactions by tick be the list «tick actions».
Return the result ofdispatch actions withinput state,actions by tick,browsing context, andactions options.
Todispatch a pause action givenactionobject,source,global keystate,tick duration,browsing context, andactions options:
Thenormalized key value for a raw keykey is, ifkey appears in the table below, the string value in the second column on the row containingkey'sunicode code point in the first column, otherwise it iskey.
| key's codepoint | Normalized key value |
|---|---|
\uE000 | "Unidentified" |
\uE001 | "Cancel" |
\uE002 | "Help" |
\uE003 | "Backspace" |
\uE004 | "Tab" |
\uE005 | "Clear" |
\uE006 | "Return" |
\uE007 | "Enter" |
\uE008 | "Shift" |
\uE009 | "Control" |
\uE00A | "Alt" |
\uE00B | "Pause" |
\uE00C | "Escape" |
\uE00D | " " |
\uE00E | "PageUp" |
\uE00F | "PageDown" |
\uE010 | "End" |
\uE011 | "Home" |
\uE012 | "ArrowLeft" |
\uE013 | "ArrowUp" |
\uE014 | "ArrowRight" |
\uE015 | "ArrowDown" |
\uE016 | "Insert" |
\uE017 | "Delete" |
\uE018 | ";" |
\uE019 | "=" |
\uE01A | "0" |
\uE01B | "1" |
\uE01C | "2" |
\uE01D | "3" |
\uE01E | "4" |
\uE01F | "5" |
\uE020 | "6" |
\uE021 | "7" |
\uE022 | "8" |
\uE023 | "9" |
\uE024 | "*" |
\uE025 | "+" |
\uE026 | "," |
\uE027 | "-" |
\uE028 | "." |
\uE029 | "/" |
\uE031 | "F1" |
\uE032 | "F2" |
\uE033 | "F3" |
\uE034 | "F4" |
\uE035 | "F5" |
\uE036 | "F6" |
\uE037 | "F7" |
\uE038 | "F8" |
\uE039 | "F9" |
\uE03A | "F10" |
\uE03B | "F11" |
\uE03C | "F12" |
\uE03D | "Meta" |
\uE040 | "ZenkakuHankaku" |
\uE050 | "Shift" |
\uE051 | "Control" |
\uE052 | "Alt" |
\uE053 | "Meta" |
\uE054 | "PageUp" |
\uE055 | "PageDown" |
\uE056 | "End" |
\uE057 | "Home" |
\uE058 | "ArrowLeft" |
\uE059 | "ArrowUp" |
\uE05A | "ArrowRight" |
\uE05B | "ArrowDown" |
\uE05C | "Insert" |
\uE05D | "Delete" |
Thecode forkey is the value in the last column of the following table on the row withkey in either the first or second column, if any such row exists, otherwise it isundefined.
Ashifted character is one that appears in the second column of the following table.
| Key | Alternate Key | code |
|---|---|---|
"`" | "~" | "Backquote" |
"\" | "|" | "Backslash" |
"\uE003" | | "Backspace" |
"[" | "{" | "BracketLeft" |
"]" | "}" | "BracketRight" |
"," | "<" | "Comma" |
"0" | ")" | "Digit0" |
"1" | "!" | "Digit1" |
"2" | "@" | "Digit2" |
"3" | "#" | "Digit3" |
"4" | "$" | "Digit4" |
"5" | "%" | "Digit5" |
"6" | "^" | "Digit6" |
"7" | "&" | "Digit7" |
"8" | "*" | "Digit8" |
"9" | "(" | "Digit9" |
"=" | "+" | "Equal" |
"<" | ">" | "IntlBackslash" |
"a" | "A" | "KeyA" |
"b" | "B" | "KeyB" |
"c" | "C" | "KeyC" |
"d" | "D" | "KeyD" |
"e" | "E" | "KeyE" |
"f" | "F" | "KeyF" |
"g" | "G" | "KeyG" |
"h" | "H" | "KeyH" |
"i" | "I" | "KeyI" |
"j" | "J" | "KeyJ" |
"k" | "K" | "KeyK" |
"l" | "L" | "KeyL" |
"m" | "M" | "KeyM" |
"n" | "N" | "KeyN" |
"o" | "O" | "KeyO" |
"p" | "P" | "KeyP" |
"q" | "Q" | "KeyQ" |
"r" | "R" | "KeyR" |
"s" | "S" | "KeyS" |
"t" | "T" | "KeyT" |
"u" | "U" | "KeyU" |
"v" | "V" | "KeyV" |
"w" | "W" | "KeyW" |
"x" | "X" | "KeyX" |
"y" | "Y" | "KeyY" |
"z" | "Z" | "KeyZ" |
"-" | "_" | "Minus" |
"." | "." | "Period" |
"'" | """ | "Quote" |
";" | ":" | "Semicolon" |
"/" | "?" | "Slash" |
"\uE00A" | | "AltLeft" |
"\uE052" | | "AltRight" |
"\uE009" | | "ControlLeft" |
"\uE051" | | "ControlRight" |
"\uE006" | | "Enter" |
"\uE00B" | | "Pause" |
"\uE03D" | | "MetaLeft" |
"\uE053" | | "MetaRight" |
"\uE008" | | "ShiftLeft" |
"\uE050" | | "ShiftRight" |
" " | "\uE00D" | "Space" |
"\uE004" | | "Tab" |
"\uE017" | | "Delete" |
"\uE010" | | "End" |
"\uE002" | | "Help" |
"\uE011" | | "Home" |
"\uE016" | | "Insert" |
"\uE00F" | | "PageDown" |
"\uE00E" | | "PageUp" |
"\uE015" | | "ArrowDown" |
"\uE012" | | "ArrowLeft" |
"\uE014" | | "ArrowRight" |
"\uE013" | | "ArrowUp" |
"\uE00C" | | "Escape" |
"\uE031" | | "F1" |
"\uE032" | | "F2" |
"\uE033" | | "F3" |
"\uE034" | | "F4" |
"\uE035" | | "F5" |
"\uE036" | | "F6" |
"\uE037" | | "F7" |
"\uE038" | | "F8" |
"\uE039" | | "F9" |
"\uE03A" | | "F10" |
"\uE03B" | | "F11" |
"\uE03C" | | "F12" |
"\uE019" | | "NumpadEqual" |
"\uE01A" | "\uE05C" | "Numpad0" |
"\uE01B" | "\uE056" | "Numpad1" |
"\uE01C" | "\uE05B" | "Numpad2" |
"\uE01D" | "\uE055" | "Numpad3" |
"\uE01E" | "\uE058" | "Numpad4" |
"\uE01F" | | "Numpad5" |
"\uE020" | "\uE05A" | "Numpad6" |
"\uE021" | "\uE057" | "Numpad7" |
"\uE022" | "\uE059" | "Numpad8" |
"\uE023" | "\uE054" | "Numpad9" |
"\uE025" | | "NumpadAdd" |
"\uE026" | | "NumpadComma" |
"\uE028" | "\uE05D" | "NumpadDecimal" |
"\uE029" | | "NumpadDivide" |
"\uE007" | | "NumpadEnter" |
"\uE024" | | "NumpadMultiply" |
"\uE027" | | "NumpadSubtract" |
Thekey location forkey is the value in the last column in the table below on the row withkey appears in the first column, if such a row exists, otherwise it is0.
| key's codepoint | Description | Location |
|---|---|---|
\uE007 | Enter | 1 |
\uE008 | Left Shift | 1 |
\uE009 | Left Control | 1 |
\uE00A | Left Alt | 1 |
\uE019 | Numpad = | 3 |
\uE01A | Numpad 0 | 3 |
\uE01B | Numpad 1 | 3 |
\uE01C | Numpad 2 | 3 |
\uE01D | Numpad 3 | 3 |
\uE01E | Numpad 4 | 3 |
\uE01F | Numpad 5 | 3 |
\uE020 | Numpad 6 | 3 |
\uE021 | Numpad 7 | 3 |
\uE022 | Numpad 8 | 3 |
\uE023 | Numpad 9 | 3 |
\uE024 | Numpad * | 3 |
\uE025 | Numpad + | 3 |
\uE026 | Numpad , | 3 |
\uE027 | Numpad - | 3 |
\uE028 | Numpad . | 3 |
\uE029 | Numpad / | 3 |
\uE03D | Left Meta | 1 |
\uE050 | Right Shift | 2 |
\uE051 | Right Control | 2 |
\uE052 | Right Alt | 2 |
\uE053 | Right Meta | 2 |
\uE054 | Numpad PageUp | 3 |
\uE055 | Numpad PageDown | 3 |
\uE056 | Numpad End | 3 |
\uE057 | Numpad Home | 3 |
\uE058 | Numpad ArrowLeft | 3 |
\uE059 | Numpad ArrowUp | 3 |
\uE05A | Numpad ArrowRight | 3 |
\uE05B | Numpad ArrowDown | 3 |
\uE05C | Numpad Insert | 3 |
\uE05D | Numpad Delete | 3 |
Todispatch a keyDown action givenactionobject,source,global key state,tickduration,browsing context, andactions options:
Letraw key be equal to theaction object'svalue property.
Letkey be equal to thenormalized key value forraw key.
If thesource'spressed property containskey, letrepeat be true, otherwise letrepeat be false.
Letcode be thecode forraw key.
Letlocation be thekey location forraw key.
LetcharCode,keyCode andwhich be the implementation-specific values of thecharCode,keyCode andwhich properties appropriate for a key with keykey and locationlocation on a 102 key US keyboard, following the guidelines in [UI-EVENTS].
Ifkey is"Alt", letsource'salt property be true.
Ifkey is"Shift", letsource'sshift property be true.
Ifkey is"Control", letsource'sctrl property be true.
Ifkey is"Meta", letsource'smeta property be true.
Addkey tosource'spressed property.
Perform implementation-specific action dispatch steps onbrowsing context equivalent to pressing a key on the keyboard in accordance with the requirements of [UI-EVENTS], and producing the following events, as appropriate, with the specified properties. This will always produce events including at least akeyDown event.
keyDown with properties:| Attribute | Value |
|---|---|
key | key |
code | code |
location | location |
altKey | source'salt property |
shiftKey | source'sshift property |
ctrlKey | source'sctrl property |
metaKey | source'smeta property |
repeat | repeat |
isComposing | false |
charCode | charCode |
keyCode | keyCode |
which | which |
keyPress with properties:| Attribute | Value |
|---|---|
key | key |
code | code |
location | location |
altKey | source'salt property |
shiftKey | source'sshift property |
ctrlKey | source'sctrl property |
metaKey | source'smeta property |
repeat | repeat |
isComposing | false |
charCode | charCode |
keyCode | keyCode |
which | which |
A singlekeyDown action produces a single key input, irrespective of how long the key is held down; there is no implicit key repetition.
Todispatch a keyUp action given,actionobject,source,global key state,tick duration,browsing context,andactions options:
Letraw key be equal toaction object'svalue property.
Letkey be equal to thenormalized key value forraw key.
If thesource'spressed item does not containkey, return.
Letcode be thecode forraw key.
Letlocation be thekey location forraw key.
LetcharCode,keyCode andwhich be the implementation-specific values of thecharCode,keyCode andwhich properties appropriate for a key with keykey and locationlocation on a 102 key US keyboard, following the guidelines in [UI-EVENTS].
Ifkey is "Alt", letsource'salt property be false.
Ifkey is "Shift", letsource'sshift property be false.
Ifkey is"Control", letsource'sctrl property be false.
Ifkey is"Meta", letsource'smeta property be false.
Removekey fromsources'spressed property.
Perform implementation-specific action dispatch steps onbrowsing context equivalent to releasing a key on the keyboard in accordance with the requirements of [UI-EVENTS], and producing at least the following events with the specified properties:
keyup, with properties:| Attribute | Value |
|---|---|
key | key |
code | code |
location | location |
altKey | source'saltKey property |
shiftKey | source'sshift property |
ctrlKey | source'sctrl property |
metaKey | source'smeta property |
repeat | false |
isComposing | false |
charCode | charCode |
keyCode | keyCode |
which | which |
Todispatch a pointerDown action givenaction object,source,global key state,tick duration,browsing context, andactions options:
LetpointerType be equal toaction object'spointerType property.
Letbutton be equal toaction object'sbutton property.
If thesource'spressed property containsbutton returnsuccess with datanull.
Letx be equal tosource'sx property.
Lety be equal tosource'sy property.
Addbutton to the set corresponding tosource'spressed property, and letbuttons be the resulting value of that property.
Letwidth be equal toaction object'swidth property.
Letheight be equal toaction object'sheight property.
Letpressure be equal toaction object'spressure property.
LettangentialPressure be equal toaction object'stangentialPressure property.
LettiltX be equal toaction object'stiltX property.
LettiltY be equal toaction object'stiltY property.
Lettwist be equal toaction object'stwist property.
LetaltitudeAngle be equal toaction object'saltitudeAngle property.
LetazimuthAngle be equal toaction object'sazimuthAngle property.
Perform implementation-specific action dispatch steps onbrowsing context equivalent to pressing the button numberedbutton on the pointer with pointerId equal tosource's pointerId, having typepointerType at viewport x coordinatex, viewport y coordinatey,width,height,pressure,tangentialPressure,tiltX,tiltY,twist,altitudeAngle,azimuthAngle, with buttonsbuttons depressed in accordance with the requirements of [UI-EVENTS] and [POINTER-EVENTS]. setctrlKey,shiftKey,altKey, andmetaKey equal to the corresponding items inglobal key state. Type specific properties for the pointer that are not exposed through the webdriver API must be set to the default value specified for hardware that doesn't support that property.
Todispatch a pointerUp action given,actionobject,source,global keystate,tick duration,browsing context,andactions options:
LetpointerType be equal toaction object'spointerType property.
Letbutton be equal toaction object'sbutton property.
If thesource'spressed property does not containbutton, returnsuccess with datanull.
Letx be equal tosource'sx property.
Lety be equal tosource'sy property.
Removebutton from the set corresponding tosource'spressed property, and letbuttons be the resulting value of that property.
Perform implementation-specific action dispatch steps onbrowsing context equivalent to releasing the button numberedbutton on the pointer with pointerId equal toinput source's pointerId, having typepointerType at viewport x coordinatex, viewport y coordinatey, with buttonsbuttons depressed, in accordance with the requirements of [UI-EVENTS] and [POINTER-EVENTS]. The generated events must setctrlKey,shiftKey,altKey, andmetaKey equal to the corresponding items inglobal key state. Type specific properties for the pointer that are not exposed through the webdriver API must be set to the default value specified for hardware that doesn't support that property.
Todispatch a pointerMove action givenactionobject,source,global key state,tick duration,browsing context,andactions options:
Letx offset be equal to thex property ofaction object.
Lety offset be equal to they property ofaction object.
Letorigin be equal to theorigin property ofaction object.
Let (x,y) be the result oftrying toget coordinates relative to an origin withsource,x offset,y offset,origin,browsing context, andactions options.
Ifx is less than 0 or greater than the width of the viewport inCSS pixels, then returnerror with error codemove target out of bounds.
Ify is less than 0 or greater than the height of the viewport inCSS pixels, then returnerror with error codemove target out of bounds.
Letduration be equal toaction object'sduration property if it is notundefined, ortick duration otherwise.
Ifduration is greater than 0 and inside any implementation-defined bounds,asynchronously wait for an implementation defined amount of time to pass.
This wait allows the implementation to model the overall pointer move as a series of small movements occurring at an implementation defined rate (e.g. one movement per vsync).
Letwidth be equal toaction object'swidth property.
Letheight be equal toaction object'sheight property.
Letpressure be equal toaction object'spressure property.
LettangentialPressure be equal toaction object'stangentialPressure property.
LettiltX be equal toaction object'stiltX property.
LettiltY be equal toaction object'stiltY property.
Lettwist be equal toaction object'stwist property.
LetaltitudeAngle be equal toaction object'saltitudeAngle property.
LetazimuthAngle be equal toaction object'sazimuthAngle property.
Perform a pointer move with argumentssource,global key state,duration,start x,start y,x,y,width,height,pressure,tangentialPressure,tiltX,tiltY,twist,altitudeAngle,azimuthAngle.
Toperform a pointer move givensource,global key state,duration,start x,start y,target x,target y,width,height,pressure,tangentialPressure,tiltX,tiltY,twist,altitudeAngle,andazimuthAngle:
Lettime delta be the time since the beginning of the currenttick, measured in milliseconds on a monotonic clock.
Letduration ratio be the ratio oftime delta andduration, ifduration is greater than 0, or 1 otherwise.
Ifduration ratio is 1, or close enough to 1 that the implementation will not further subdivide the move action, letlast be true. Otherwise letlast befalse.
Iflast is true, letx equaltarget x andy equaltarget y.
Otherwise letx equal an approximation toduration ratio × (target x -start x) +start x, andy equal an approximation toduration ratio × (target y -start y) +start y.
Letcurrent x equal thex property ofinput state.
Letcurrent y equal they property ofinput state.
Ifx is not equal tocurrent x ory is not equal tocurrent y, run the following steps:
Letbuttons be equal to input state'sbuttons property.
Perform implementation-specific action dispatch steps onbrowsing context equivalent to moving the pointer with pointerId equal toinput source's pointerId, having typepointerType from viewport x coordinatecurrent x, viewport y coordinatecurrent y to viewport x coordinatex and viewport y coordinatey,width,height,pressure,tangentialPressure,tiltX,tiltY,twist,altitudeAngle,azimuthAngle, with buttonsbuttons depressed, in accordance with the requirements of [UI-EVENTS] and [POINTER-EVENTS]. The generated events must setctrlKey,shiftKey,altKey, andmetaKey equal to the corresponding items inglobal key state. Type specific properties for the pointer that are not exposed through the WebDriver API must be set to the default value specified for hardware that doesn't support that property. In the case where thepointerType is "pen" or "touch", andbuttons is empty, this may be a no-op. For a pointer of type "mouse" this will always produce events including at least apointerMove event.
Letinput state'sx property equalx andy property equaly.
Iflast is true, return.
Run the following substepsin parallel:
This algorithm may trigger multiple events spread across some duration. Parallelism is applied intentionally in order to manage the scheduling of these events relative to the events triggered by other actions in the same tick.
The initial pointer movement is performed synchronously. This ensures determinism in the sequence of the first event triggered by each action in the tick.
Subsequent movements (if any) are performed asynchronously. This allows events from twopointerMove actions in the tick to be interspersed.
Asynchronously wait for an implementation defined amount of time to pass.
This wait allows the implementation to model the overall pointer move as a series of small movements occurring at an implementation defined rate (e.g. one movement per vsync).
Perform a pointer move with argumentsinput state,duration,start x,start y,target x,target y.
Todispatch a pointerCancel action givenactionobject,source,global key state,tick duration,browsing context,andactions options:
Perform implementation-specific action dispatch steps onbrowsing context equivalent to cancelling the any action of the pointer with pointerId equal tosource's pointerId item. having typepointerType, in accordance with the requirements of [UI-EVENTS] and [POINTER-EVENTS].
Todispatch a scroll action givenactionobject,source,global key state,tick duration,browsing context,andactions options:
Letx offset be equal to thex property ofaction object.
Lety offset be equal to they property ofaction object.
Letorigin be equal to theorigin property ofaction object.
Let (x,y) be the result oftrying toget coordinates relative to an origin withsource,x offset,y offset,origin,browsing context, andactions options.
Ifx is less than 0 or greater than the width of the viewport inCSS pixels, then returnerror with error codemove target out of bounds.
Ify is less than 0 or greater than the height of the viewport inCSS pixels, then returnerror with error codemove target out of bounds.
Letdelta x be equal to thedeltaX property ofaction object.
Letdelta y be equal to thedeltaY property ofaction object.
Letduration be equal toaction object'sduration property if it is notundefined, ortick duration otherwise.
Ifduration is greater than 0 and inside any implementation-defined bounds,asynchronously wait for an implementation defined amount of time to pass.
This wait allows the implementation to model the overall wheel scroll as a series of small scroll occurring at an implementation defined rate (e.g. one scroll per vsync).
Perform a scroll with argumentsglobal key state,duration,x,y,delta x,delta y,0,0.
Toperform a scroll givenduration,x,y,target delta x,target delta y,current delta x andcurrent delta y:
Lettime delta be the time since the beginning of the currenttick, measured in milliseconds on a monotonic clock.
Letduration ratio be the ratio oftime delta andduration, ifduration is greater than 0, or 1 otherwise.
Ifduration ratio is 1, or close enough to 1 that the implementation will not further subdivide the move action, letlast be true. Otherwise letlast befalse.
Iflast is true, letdelta x equaltarget delta x -current delta x anddelta y equaltarget delta y -current delta y.
Otherwise letdelta x equal an approximation toduration ratio ×target delta x -current delta x, anddelta y equal an approximation toduration ratio ×target delta y -current delta y.
Ifdelta x is not equal to0 ordelta y is not equal to0, run the following steps:
Perform implementation-specific action dispatch steps onbrowsing context equivalent to wheel scroll at viewport x coordinatex, viewport y coordinatey, deltaX valuedelta x, deltaY valuedelta y, in accordance with the requirements of [UI-EVENTS]. The generated events must setctrlKey,shiftKey,altKey, andmetaKey equal to the corresponding items inglobal key state.
Letcurrent delta x property equaldelta x +current delta x andcurrent delta y property equaldelta y +current delta y.
Iflast is true, return.
Run the following substepsin parallel:
This algorithm may trigger multiple events spread across some duration. Parallelism is applied intentionally in order to manage the scheduling of these events relative to the events triggered by other actions in the same tick.
The initial scroll is performed synchronously. This ensures determinism in the sequence of the first event triggered by each action in the tick.
Subsequent scrolls (if any) are performed asynchronously. This allows events from twoscroll actions in the tick to be interspersed.
Asynchronously wait for an implementation defined amount of time to pass.
This wait allows the implementation to model the overall scroll as a series of small scrolls occurring at an implementation defined rate (e.g. one scroll per vsync).
Perform a scroll with argumentsduration,x,y,target delta x,target delta y,current delta x,current delta y.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/actions |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letinput state be the result ofget the input state withsession andsession'scurrent top-level browsing context.
Letactions options be a newactions options with theis element origin steps set torepresents a web element, and theget element origin steps set toget a WebElement origin.
Letactions by tick be the result oftrying toextract an action sequence withinput state,parameters, andactions options.
Dispatch actions withinput state,actions by tick,current browsing context, andactions options. If this results in anerror return that error.
| HTTP Method | URI Template |
|---|---|
| DELETE | /session/{session id}/actions |
TheRelease Actionscommandis used to release all the keys and pointer buttonsthat are currently depressed.This causes events to befiredas if the state was released by an explicit series of actions.It also clears all the internal state of the virtual devices.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letinput state be the result ofget the input state withsession andcurrent top-level browsing context.
Letactions options be a newactions options with theis element origin steps set torepresents a web element, and theget element origin steps set toget a WebElement origin.
Wait for an action queue token withinput state.
Letundo actions beinput state'sinput cancel list in reverse order.
Try todispatch actions withinput state,undo actions,current browsing context, andactions options.
Reset the input state withsession andsession'scurrent top-level browsing context.
This chapter describes interaction with various types ofuser prompts. The common denominator for user prompts is that they are modal windows requiring users to interact with them before theevent loop isunpaused and control is returned tosession'scurrent top-level browsing context.
By defaultuser prompts are not handled automatically unless auser prompt handler has been defined. When auser prompt appears, it is the task of the subsequentcommand to handle it. If the subsequent requestedcommand is not one listed in this chapter, anunexpected alert openerror will be returned.
Wheneveractive sessions is a list containing exactly oneitem, and that item is aHTTP session, but is not aBiDisession, then in thesteps to fire beforeunload,implementations must act as if showing an unload prompt is likely tobe annoying, deceptive, or pointless.
This means that beforeunload prompts are never shownwhen there's an active HTTP-only session.
Auser prompt has an associateduser prompt message that is the string message shown to the user, ornull if the message length is0.
Toget the active user prompt givenbrowsing context:
Letagent bebrowsing context'sactive document'srelevant agent.
Ifagent'sevent loop is not currentlypaused, return null.
Return theuser prompt which handles the input required to meet the condition passed whenevent loop waspaused.
Thecurrent user prompt is the result ofget theactive user prompt withcurrent browsing context.
Todismiss auser prompt, act as if the user clicked theCancel button on that prompt, if present, or otherwiseaccept the prompt.
Toaccept auser prompt, act as if the user clicked theOK button on that prompt.
Aremote end has auser prompt handler whichdefines how a WebDriver session will react when a user prompt isdisplayed. It is either null or amap between stringsandprompt handler configuration values. Initially it is null.
Aprompt handler configuration is astruct with twoitems; ahandler, which is astring, and anotify,which is a boolean.
Toserialize a prompt handler configurationgivenconfiguration:
Letserialized beconfiguration'shandler.
If «"dismiss", "accept"»containsserialized, andconfiguration'snotify is true, append " and notify" toserialized.
Returnserialized.
| Handler key | Description (non-normative). |
|---|---|
"dismiss" | Allsimple dialogs encountered should bedismissed. |
"accept" | Allsimple dialogs encountered should beaccepted. |
"dismiss and notify" | Allsimple dialogs encountered should bedismissed, and an error returned that the dialog was handled. |
"accept and notify" | Allsimple dialogs encountered should beaccepted, and an error returned that the dialog was handled. |
"ignore" | Allsimple dialogs encountered should be left to the user to handle. |
Thevalid prompt types are «"alert","beforeUnload", "confirm","default", "file", "prompt"».
The "default" type represents a fallbackwhen no specific handler is defined for a given prompt type, includingthe "beforeUnload" prompt type. It can only be set if theunhandled prompt behavior is amap whichcontains "default". For HTTP-only sessions settingunhandled prompt behavior as a string value, the value will be assigned tothe internal type "fallbackDefault". The"fallbackDefault" value is not used for the"beforeUnload" prompt type, instead it falls back to the"accept" handler. This is because HTTP-only sessions do notallow the "beforeUnload" handler to be customized, and enablingother protocols isn't expected to change the user prompt handling as aside effect.
The "file" prompt type is respected only in[WebDriver-BiDi] sessions.
Todeserialize as an unhandled prompt behavior givenargumentvalue:
Setvalue to the result ofconverting a JSON-derived JavaScript value to an Infra value withvalue.
Ifvalue is not a string, an implementation that does not also support [WebDriver-BiDi] may returnerror witherror codeinvalid argument.
This is to avoid [WebDriver-BiDi] monkey-patching the current spec.
Letis string value be false.
Ifvalue is astring setvalue to themap «["fallbackDefault" →value]» and setis string value to true.
Ifvalue is not amap returnerror witherror codeinvalid argument.
For eachprompt type →handler invalue:
Ifis string value is false andvalid prompt types does notcontainprompt type returnerror witherror codeinvalid argument.
Ifknown prompt handlers does not contain an entry withhandler keyhandler returnerror witherror codeinvalid argument.
Letnotify be false.
Ifhandler is "accept and notify", sethandler to "accept" andnotify to true.
Ifhandler is "dismiss and notify", sethandler to "dismiss" andnotify to true.
Ifhandler is "ignore", setnotify to true.
Letconfiguration be aprompt handler configuration withhandlerhandler andnotifynotify.
Setuser prompt handler[prompt type] toconfiguration.
Returnsuccess with datauser prompt handler.
Tocheck user prompt handler matchesgivenrequested prompt handler:
If theuser prompt handler is null, return true.
For eachrequest prompt type →request handler inrequested prompt handler:
If theuser prompt handlercontainsrequest prompt type:
If therequested prompt handler'shandler is not equal to theuser prompt handler'shandler, return false.
This does not check therequested prompthandler'snotify matchesthehandler, because thenotify component only affects theHTTP session, if any.
Toupdate the user prompt handler givenrequested prompt handler:
If theuser prompt handler is null, set theuser prompt handler to an empty map.
For eachrequest prompt type →request handler inrequested prompt handler:
Setuser prompt handler[request prompt type] torequest handler.
Toserialize the user prompt handler:
If theuser prompt handler is null, return "dismiss and notify".
If theuser prompt handler hassize 1, anduser prompt handlercontains "fallbackDefault", return the result ofserialize a prompt handler configuration withuser prompt handler["fallbackDefault"].
Letserialized be an emptymap.
For eachkey →value ofuser prompt handler:
Setserialized[key] toserialize a prompt handler configuration withvalue.
Returnconvert an Infra value to a JSON-compatible JavaScript value withserialized.
Anannotated unexpected alert open error is anerror witherror codeunexpected alert open and an optionalerror data dictionary with the following entries:
text"Toget the prompt handlertype:
If theuser prompt handler is null, lethandlers be an empty map. Otherwise lethandlers beuser prompt handler.
Ifhandlers containstype returnhandlers[type].
Ifhandlers contains "default" returnhandlers["default"].
Iftype is "beforeUnload", return aprompt handler configuration withhandler "accept" andnotify false.
Ifhandlers contains "fallbackDefault" returnhandlers["fallbackDefault"].
Return aprompt handler configuration withhandler "dismiss" andnotify true.
Tohandle any user prompts:
If thecurrent browsing context is not blocked by a dialog returnsuccess.
Lettype be "default".
If thecurrent user prompt is an alert dialog, settype to "alert". Otherwise, if thecurrent user prompt is a beforeunload dialog, settype to "beforeUnload". Otherwise, if thecurrent user prompt is a confirm dialog, settype to "confirm". Otherwise, if thecurrent user prompt is a prompt dialog, settype to "prompt".
Lethandler beget the prompt handler withtype.
Perform the following substeps based onhandler'shandler:
accept"dismiss"ignore"Do nothing.
Ifhandler'snotifyis true, returnannotated unexpected alert open error.
Returnsuccess.
When returning anerror withunexpected alert open,aremote end may choose to return theuser prompt messageas part of an additional "data"Objecton theerror representation:
{"error":"unexpected alert open","message":"implementation defined","stacktrace":"","data": {"text":"the text from the alert"}}| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/alert/dismiss |
TheDismiss Alertcommanddismisses asimple dialogifpresent.A request todismiss an alertuser prompt,which may not necessarily have a dismiss button,has the same effect asaccepting it.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
If thecurrent user prompt is null, returnerror witherror codeno such alert.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/alert/accept |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
If thecurrent user prompt is null, returnerror witherror codeno such alert.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/alert/text |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
If thecurrent user prompt is null, returnerror witherror codeno such alert.
Letmessage be the text message associated with thecurrent user prompt, or otherwise benull.
Returnsuccess with datamessage.
| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/alert/text |
TheSend Alert Textcommandsets the text field of awindow.promptuser prompt to the given value.
Theremote end steps, givensession,URLvariables andparameters are:
Lettext be the result ofgetting the property "text" fromparameters.
Iftext is not aString, returnerror witherror codeinvalid argument.
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
If thecurrent user prompt is null, returnerror witherror codeno such alert.
Run the substeps for the API that created thecurrent user prompt:
window.alertwindow.confirmReturnerror witherror codeelement not interactable.
window.promptDo nothing.
Returnerror witherror codeunsupported operation.
Perform user agent dependent steps to set the value ofcurrent user prompt's text field totext.
Screenshots are a mechanism for providing additional visual diagnostic information. They work by dumping a snapshot of theinitial viewport's framebuffer as a lossless PNG image. It is returned to thelocal end as a Base64 encoded string.
WebDriver provides theTake Screenshotcommand to capture thetop-level browsing context'sinitial viewport, and acommandTake Element Screenshot for doing the same with the visible region of anelement'sbounding rectangle after it has beenscrolled into view.
In order todraw a bounding box from the framebuffer, given arectangle:
If either theinitial viewport's width or height is 0CSS pixels, returnerror witherror codeunable to capture screen.
Letpaint width be theinitial viewport's width –min(rectangle x coordinate,rectangle x coordinate +rectangle width dimension).
Letpaint height be theinitial viewport's height –min(rectangle y coordinate,rectangle y coordinate +rectangle height dimension).
Letcanvas be a newcanvas element, and set itswidth andheight topaint width andpaint height, respectively.
Letcontext, acanvas context mode, be the result of invoking the2D context creation algorithm givencanvas as the target.
Complete implementation specific steps equivalent to drawing the region of the framebuffer specified by the following coordinates ontocontext:
Returnsuccess withcanvas.
Toencode a canvas as Base64 acanvaselement:
If thecanvas element's bitmap'sorigin-clean flag is set to false, returnerror witherror codeunable to capture screen.
If thecanvas element's bitmap has no pixels (i.e. either its horizontal dimension or vertical dimension is zero) then returnerror witherror codeunable to capture screen.
Letfile bea serialization of thecanvas element's bitmap as a file, using "image/png" as an argument.
Letindex be theindex of "," indata URL.
Letencoded string be asubstring ofdata URL using (index + 1) as thestart argument.
Returnsuccess with dataencoded string.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/screenshot |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
When the user agent is next torun the animation frame callbacks:
Letroot rect besession'scurrent top-level browsing context'sdocument element'srectangle.
Letscreenshot result be the result oftrying to calldraw a bounding box from the framebuffer, givenroot rect as an argument.
Letcanvas be acanvas element ofscreenshot result's data.
Letencoding result be the result oftryingencoding a canvas as Base64canvas.
Letencoded string beencoding result's data.
Returnsuccess with dataencoded string.
| HTTP Method | URI Template |
|---|---|
| GET | /session/{session id}/element/{element id}/screenshot |
TheTake Element Screenshotcommandtakes a screenshot of the visible region encompassedby thebounding rectangle of anelement.
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letelement be the result oftrying toget a known element withsession andURL variables["element id"].
Scroll into view theelement.
When the user agent is next torun the animation frame callbacks:
Letelement rect beelement'srectangle.
Letscreenshot result be the result oftrying to calldraw a bounding box from the framebuffer, givenelement rect as an argument.
Letcanvas be acanvas element ofscreenshot result's data.
Letencoding result be the result oftryingencoding a canvas as Base64canvas.
Letencoded string beencoding result's data.
Returnsuccess with dataencoded string.
The print functions are a mechanism to render the document to a paginated format. It is returned to thelocal end as a Base64 encoded string containing a PDF representation of the paginated document.
When required toparse a page range withargumentspageRanges andtotalPages, animplementation must:
Ifrange is aNumber:
Otherwise:
-" character.Otherwise:
1. Otherwise letlowerBound be the result oftrying toparse as an integer the first element ofrangeParts.AString isequivalent to an empty string if ithas zero length after removing allwhitespace characters.
When required toparse as an integer withargumentinput an implementation must:
U+0030 -U+0039 (i.e. 0 - 9) inclusive, returnerror with statusinvalid argument.10.| HTTP Method | URI Template |
|---|---|
| POST | /session/{session id}/print |
Theremote end steps, givensession,URLvariables andparameters are:
Ifsession'scurrent top-level browsing context isno longer open, returnerror witherror codeno such window.
Try tohandle any user prompts withsession.
Letorientation be the result ofgetting a property with default named "orientation" and with default "portrait" fromparameters.
Iforientation is not aString or does not have one of the values "landscape" or "portrait", returnerror witherror codeinvalid argument.
Letscale be the result ofgetting a property with default named "scale" and with default1 fromparameters.
Ifscale is not aNumber, or is less than0.1 or greater than2 returnerror witherror codeinvalid argument.
Letbackground be the result ofgetting a property with default named "background" and with defaultfalse fromparameters.
Ifbackground is not aBoolean returnerror witherror codeinvalid argument.
Letpage be the result ofgetting a property with default named "page" and with a default of an emptyObject fromparameters.
LetpageWidth be the result ofgetting a property with default named "width" and with a default of21.59 frompage.
LetpageHeight be the result ofgetting a property with default named "height" and with a default of27.94 frompage.
If either ofpageWidth orpageHeight is not aNumber, or is less than(2.54 / 72), returnerror witherror codeinvalid argument.
The minimum page size is1 point, which is(2.54 / 72) as perabsolute lengths.
Letmargin be the result ofgetting a property with default named "margin" and with a default of an emptyObject fromparameters.
LetmarginTop be the result ofgetting a property with default named "top" and with a default of1 frommargin.
LetmarginBottom be the result ofgetting a property with default named "bottom" and with a default of1 frommargin.
LetmarginLeft be the result ofgetting a property with default named "left" and with a default of1 frommargin.
LetmarginRight be the result ofgetting a property with default named "right" and with a default of1 frommargin.
If any ofmarginTop,marginBottom,marginLeft, ormarginRight is not aNumber, or is less then 0, returnerror witherror codeinvalid argument.
LetshrinkToFit be the result ofgetting a property with default named "shrinkToFit" and with defaulttrue fromparameters.
IfshrinkToFit is not aBoolean returnerror witherror codeinvalid argument.
LetpageRanges be the result ofgetting a property with default named "pageRanges" fromparameters with default of an emptyArray.
IfpageRanges is not anArray returnerror witherror codeinvalid argument.
When the user agent is next torun the animation frame callbacks, letpdfData be the result oftrying to take UA-specific steps to generate a paginated representation ofsession'scurrent browsing context, with the CSSmedia type set toprint, encoded as a PDF, with the following paper settings:
| Property | Value |
|---|---|
| Width in cm | pageWidth iforientation is "portrait" otherwisepageHeight |
| Height in cm | pageHeight iforientation is "portrait" otherwisepageWidth |
| Top margin, in cm | marginTop |
| Bottom margin, in cm | marginBottom |
| Left margin, in cm | marginLeft |
| Right margin, in cm | marginRight |
In addition, the following formatting hints should be applied by the UA:
1falsetrueIfpageRanges is not an emptyArray, Letpages be the result oftrying toparse a page range with argumentspageRanges and the number of pages contained inpdfData, then remove any pages frompdfData whose one-based index is not contained inpages
Letencoding result be the result of callingBase64 Encode onpdfData.
Letencoded string beencoding result's data.
Returnsuccess with dataencoded string
It is advisable thatremote endscreate a new profile whencreating a new session.This prevents potentially sensitive session datafrom being accessible to newsessions,ensuring both privacy and preventing state from bleeding through to the next session.
A user agent can rely on a command-line flag or a configuration option to test whether to enable WebDriver, or alternatively make the user agent initiate or confirm the connection through a privileged content document or control widget, in case the user agent does not directly implement the HTTP endpoints.
It is strongly suggested that user agents require users to take explicit action to enable WebDriver, and that WebDriver remains disabled in publicly consumed versions of the user agent.
To prevent arbitrary machines on the network from connecting and creatingsessions, it is suggested that only connections from loopback devices are allowed by default.
Theremote end can include a configuration option to limit the accepted IP range allowed to connect and make requests. The default setting for this might be to limit connections to the IPv4 localhost CIDR range127.0.0.0/8 and the IPv6 localhost address::1. [RFC4632]
It is also suggested that user agents make an effort to visually distinguish a user agent session that is under control of WebDriver from those used for normal browsing sessions. This can be done through abrowser chrome element such as a “door hanger”, colorful decoration of the OS window, or some widget element that is prevalent in the window so that it easy to identify automation windows.
Although WebDriver does not define a primitive to ascertain the visibility of anelement in theviewport, we acknowledge that it is an important feature for many users. Here we include a recommended approach which will give a simplified approximation of anelement's visibility, but please note that it relies only on tree-traversal, and only covers a subset of visibility checks.
The visibility of anelement is guided by what is perceptually visible to the human eye. In this context, anelement's displayedness does not relate to thevisibility ordisplay style properties.
The approach recommended to implementors to ascertain anelement's visibility was originally developed by theSelenium project, and is based on crude approximations about anelement's nature and relationship in the tree. Anelement is in general to be considered visible if any part of it is drawn on the canvas within the boundaries of the viewport.
Theelement displayed state is a boolean representingwhether an element is currently visible.
To get theelement displayed state usingthebot.dom.isShown Selenium atoms,givenelement:
Letfunction be thebot.dom.isShown function.
Letresult be the result of callingfunction's[[Call]] internal method with arguments null andelement. If this raises an exception, return anerror witherror codeunknown error.
Returnsuccess with dataresult.
Theelement displayed state is typically exposed as an endpoint forGET requests with aURI Template of/session/{session id}/element/{element id}/displayed.
There have been a lot of people that have helped makebrowser automation possible over the yearsand thereby furthered the goals of this standard.In particular, thanks goes to theSelenium Open Source community,without which this standard would never have been possible.
This standard is authored by Aleksey Chemakin,Andreas Tolfsen, Andrey Botalov, Brian Burg, Christian Bromann, Clayton Martin, Daniel Wagner-Hall,David Burns, Dominique Hazael-Massieux, Eran Messeri, Erik Wilde, Gábor Csárdi, Henrik Skupin, James Graham, Jason Juang, Jason Leyba, Jim Evans, John Chen, John Jansen, Jonathan Lipps, Jonathon Kereliuk, Luke Inman-Semerau,Maja Frydrychowicz, Malini Das, Manoj Kumar, Marc Fisher, Mike Pennisi, Ondřej Machulda, Randall Kent, Sam Sneddon, Seva Lotoshnikov,Simon Stewart, Sri Harsha, Titus Fortner, and Vangelis Katsikaros.The work is coordinated and edited byDavid BurnsandSimon Stewart.
Thanks toBerge Schwebs Bjørlo,Lukas Tetzlaff,Malcolm Rowe,Michael[tm] Smith,Nathan Bloomfield,Philippe Le Hégaret,Robin Berjon,Ross Patterson,and Wilhelm Joys Andersenfor proofreading and suggesting areas for improvement.
This specification relies on several other underlying specifications.
The following terms are defined in the Accessible Rich Internet Applications (WAI-ARIA) 1.2 specification: [wai-aria-1.2]
The following terms are defined in the Accessible Name and Description Computation 1.1 specification: [accname-1.1]
The following terms are defined in the Content Security Policy Level 3 specification: [CSP3]
The following terms are defined in The Base16, Base32, and Base64 Data Encodings specification: [RFC4648]
The following terms are defined in the DOM Parsing and Serialization specification: [DOM-PARSING]
The following attributes are defined in the UI Events specification: [UI-EVENTS]
The following attributes are defined in the UI Events Code specification: [UIEVENTS-KEY]
The following terms are defined in the ECMAScript Language Specification: [ECMA-262]
The following terms are defined in the WHATWG Encoding specification: [ENCODING]
The following terms are defined in the WHATWG Fetch specification: [FETCH]
The following terms are defined in the WHATWG Fullscreen specification: [FULLSCREEN]
The following terms are defined in the HTML specification: [HTML]
activeElement attribute onDocumentDocument object[[GetOwnProperty]] of aWindow objectWindow objectWindowProxy exotic objectsetSelectionRangeconfirmalertpromptThe HTML specification also definesstates of theinput element:
The HTML specification also defines a range of different attributes:
The HTML Editing APIs specification defines the following terms: [EDITING]
The following events are also defined in the HTML specification:
The “data” URL scheme specification defines the following terms: [RFC2397]
To beHTTP compliant, it is supposed that the implementation supports the relevant subsets of [RFC7230], [RFC7231], [RFC7232], [RFC7234], and [RFC7235].
The following terms are defined in the Cookie specification: [RFC6265]
The following terms are defined in the Same Site Cookie specification: [RFC6265bis]
The following terms are defined in the Hypertext Transfer Protocol (HTTP) Status Code Registry:
The following terms are defined in the Infra specification: [INFRA]
The specification usesURI Templates. [URI-TEMPLATE]
hiddenvisibilityState attribute onDocumentvisible775cfb33b193eb8832cd5488f298006f45254685.visibility propertydisplay propertyThe following terms are defined in the standard: [RFC1928]
The IDL fragments in this specification must be interpreted as required for conforming IDL fragments, as described in the Web IDL specification. [WEBIDL]
The following terms are defined in the Promises Guide. [PROMISES-GUIDE]
The following terms are defined in the Document Object Model XPath standard [XPATH]
[[Call]] internal slot forFunction§E.[[GetOwnProperty]] internal slot forObject§E.§E.[[GetProperty]] internal slot forObject§E.NavigatorAutomationInformation interface§4.[[Put]] internal slot forObject§E.getBoundingClientRect() (forElement)getClientRects() (forElement)compareDocumentPosition() (forNode)tree)Node)DOMTokenList interfaceElement interfacegetAttribute() (forElement)getElementsByTagName() (forElement)hasAttribute() (forElement)HTMLCollection interfacetree)tree)isTrusted attribute (forEvent)Node)NodeList interfacequerySelectorAll() (forParentNode)ShadowRoot interfacetagName attribute (forElement)textContent attribute (forNode)Document)FileList interfaceDOMRect interfacea elementnavigable)address elementcanvas elementdatalist elementframe elementheight attribute (forcanvas element)HTMLAllCollection interfaceHTMLFormControlsCollection interfaceHTMLOptionsCollection interfaceiframe elementNavigator interfaceoptgroup elementoption elementoutput elementreadonly attribute (forinput element)select elementtextarea elementtitle attribute (forDocument)type attribute (forinput element)width attribute (forcanvas element)WorkerNavigator interfacelist)map)iteration)map)map)struct)string)map)map)iteration)Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in: