diff --git a/01_introduction.html b/01_introduction.html --- a/01_introduction.html +++ b/01_introduction.html @@ -48,9 +48,67 @@
The IDL fragments in this specification must be interpreted as required for conforming IDL fragments, as described in the Web IDL specification [[!WEBIDL]].
This specification describes the conformance criteria for both local (relevant to creating bindings for languages) and remote end implementations (relevant to browser vendors and server implementors). A final conformance class — intermediate node — is also specified. These represent those nodes situated between the local and remote ends.
In equations, all numbers are integers, subtraction is + represented by “−”, and bitwise OR by “|”. The characters “(” + and “)” are used to provide logical grouping in these contexts. +
When asked to normalize style pixel values to integer + for a value s: + +
When asked to normalize style pixel values to floating + point for a value s: + +
ceil so that
+ it has no more than four decimals.
+
+ These operations are almost equivalent to calling
+ parseInt
+ and parseFloat
+ from [[!ECMA-262]] with the exception that non-valid integer
+ or float return values are returned as 0 or 0.0.
+
WebDriver implementations MUST allow the users to be able to get the
- current URL. In the case of a Nested Browsing Context WebDriver MUST return the URL of the [[html51]] top level browsing context.
- It is the equivalent to returning document.location.href for the [[html51]] top level browsing context.
+ current URL. In the case of a Nested Browsing Context WebDriver MUST return the URL of the [[!HTML51]] top level browsing context.
+ It is the equivalent to returning document.location.href for the [[!HTML51]] top level browsing context.
If the page takes too long as specified by the timeouts a timeout error MUST be raised. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
| Notes | ||
|---|---|---|
| POST | /session/{sessionId}/back |
The "goBack" command is equivalent to a user hitting the "back" button in their browser, and MUST behave as a traversal of the browser history by a delta of -1 (as defined in [[!html51]]). If a user calls "goBack" when there are no further pages in the browser's history stack, then this call MUST be a no-op.
+
The "goBack" command is equivalent to a user hitting the "back" button in their browser, and MUST behave as a traversal of the browser history by a delta of -1 (as defined in [[!HTML51]]). If a user calls "goBack" when there are no further pages in the browser's history stack, then this call MUST be a no-op.
If the page takes too long as specified by the timeouts a timeout error MUST be raised. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
| HTTP Method | @@ -116,17 +116,17 @@Notes | |
|---|---|---|
| POST | /session/{sessionId}/forward |
The "goForward" command is equivalent to a user hitting the "forward" button in their browser, and MUST behave as a traversal of the browser history by a delta of +1 (as defined in [[!html51]]). If a user calls "goForward" when there are no further pages in the browser's history stack, then this call MUST be a no-op.
+
The "goForward" command is equivalent to a user hitting the "forward" button in their browser, and MUST behave as a traversal of the browser history by a delta of +1 (as defined in [[!HTML51]]). If a user calls "goForward" when there are no further pages in the browser's history stack, then this call MUST be a no-op.
If the page takes too long as specified by the timeouts a timeout error MUST be raised. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
| POST | /session/{sessionId}/title |
- The "getTitle" command MUST return the contents of the <title> element like it would for document.title. In the case of a Nested Browsing Context WebDriver MUST return the title of the [[html51]] top level browsering context.
+ The "getTitle" command MUST return the contents of the <title> element like it would for document.title. In the case of a Nested Browsing Context WebDriver MUST return the title of the [[HTML51]] top level browsering context.
If the page takes too long as specified by the timeouts a timeout error MUST be raised. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
Within this specification, a window equates to [[!html51]]'s top level browsing context. Put another way, within this spec browser tabs are counted as separate windows.
+Within this specification, a window equates to [[!HTML51]]'s top level browsing context. Put another way, within this spec browser tabs are counted as separate windows.
TODO: define "frame"
A Window Handow is an opaque string that MUST uniquely identify the top level browsing context and MUST NOT be "current". This MAY be a UUID.
Web applications can be composed of multiple top level browsing context and/or frames. For a normal user, the context in which an operation is performed is obvious: it's the window or frame that currently has OS focus and which has just received user input. The WebDriver API does not follow this convention. There is an expectation that many browsers using the WebDriver API may be used at the same time on the same machine. This section describes how WebDriver tracks which window or frame is currently the context in which commands are being executed.
WebDriver's default content is [[!html51]]'s top level browsing context that is currently receiving WebDriver commands.
+WebDriver's default content is [[!HTML51]]'s top level browsing context that is currently receiving WebDriver commands.
When a WebDriver instance is started and a single OS window is opened, the default content of that OS window is automatically selected for receiving further commands. If more than one OS window or multiple top level browsing contexts are opened when the session starts, then the user MUST first select which top level browsing context to act upon using the switchToWindow command. Until the user selects a top level browsing context, all commands must return a status code of no such window.
The "switchToParentFrame" command MUST set the context of future commands to the window.parent. If the current context is the [[!html51]]'s top level browsing context, the context remains unchanged.
The "switchToParentFrame" command MUST set the context of future commands to the window.parent. If the current context is the [[!HTML51]]'s top level browsing context, the context remains unchanged.
All browsers must comply with the focus section of - the [[!html51]] spec. In particular, the requirement that the active element within a top-level browsing + the [[!HTML51]] spec. In particular, the requirement that the active element within a top-level browsing context be independent of whether or not the top-level browsing context itself has system focus MUST be followed.
This requirement is put in place to allow efficient machine utilization when using the WebDriver API to control several browsers independently on the same desktop
Where "search_term" is the link text being searched for, and "result" contains the list of elements to return.
Strategy name: xpath
-All WebDriver implementations MUST support finding elements by XPath 1.0 [[!XPATH]] with the edits from section 3.3 of the [[!html51]] specification made. If no native support is present in the browser, a pure JS implementation MAY be used. When called, the returned values MUST be equivalent of calling "evaluate" function from [[DOM-LEVEL-3-XPATH]] with the result type set to "ORDERED_NODE_SNAPSHOT_TYPE (7).
+All WebDriver implementations MUST support finding elements by XPath 1.0 [[!XPATH]] with the edits from section 3.3 of the [[!HTML51]] specification made. If no native support is present in the browser, a pure JS implementation MAY be used. When called, the returned values MUST be equivalent of calling "evaluate" function from [[DOM-LEVEL-3-XPATH]] with the result type set to "ORDERED_NODE_SNAPSHOT_TYPE (7).
The visibility of a Document element
+ is guided by what is perceptually visible to the human eye.
+ An element's visibility does in this context thus not relate
+ in any way to the visibility
+ or display
+ style properties [[!CSS3BOX]].
+
+
The approach used by WebDriver to ascertain an element's + visibility is based on crude approximations about the element's + nature and relationship in the tree. An element is in general + to be considered visible if any part of it is drawn on the + canvas within the bounderies of the viewport. + +
An element's element visibility + is a boolean state where true signifies visibility and false + invisibility. To compute the state on element: + +
hidden is set, return false.
+
+ display style
+ property is "none", return false.
+
+
+ document.documentElement:
+
+ background-color
+ property is "transparent", run these substeps:
+
+ HTML
+ element [[!HTML51]], and the computed value of the
+ background-color style property of the first
+ BODY element descendant of the element in
+ tree
+ order, relative to that element, is also "transparent",
+ return false.
+
+ option or
+ optgroup element:
+
+ select element,
+ return the result of applying the element visibility
+ algorithm on it if its result is false.
+ map element, run
+ these substeps:
+
+ img element, image element
+ in the document with a name attribute matching
+ the value of element's usemap
+ attribute, run these substeps:
+
+ area element:
+
+ map element,
+ apply the element visibility algorithm on it.
+
+ getBoundingClientRect on
+ child.
+
+ height property of
+ rectangle is
+ greater than zero CSS pixels, and the value of the
+ width property of rectangle is
+ greater than zero CSS pixels:
+
+ overflow-x or
+ overflow-y is "hidden":
+
+ DOMRect
+ that is the first element of the DOMRectList
+ array returned by calling getClientRects
+ on parent.
+
+ DOMRect
+ that is the first element of the DOMRectList
+ array returned by calling getClientRects
+ on element.
+
+ top
+ is less than (parent dimension's bottom
+ − the normalized style pixel float value of parent
+ style's borderBottomWidth).
+
+ bottom
+ is less than (parent dimension's top
+ − the normalized style pixel float value of parent
+ style's borderTopWidth).
+
+ left
+ is less than (parent dimension's right
+ − the normalized style pixel float value of parent
+ style's borderRightWidth casted as a
+ float).
+
+ right
+ is less than (parent dimension's left
+ − the normalized style pixel float value of parent
+ style's borderLeftWidth casted as a
+ float).
+ If the steps above return true, then the element MUST also + be interactable should it + meet the other criteria for being interactable. If any part of + the BODY can be brought into the current viewport, the return + value MUST be true. +
+
| HTTP Method | Path Template | Notes | |
|---|---|---|---|
| GET | -/session/{sessionId}/element/{ELEMENT}/displayed | +/session/{sessionId}/element/{element}/displayed |
The following steps MUST be used to determine if an element is displayed to a user.
-display:none in its computed CSS style.element.getBoundingClientRect()
- then it MUST be displayed.overflow:hidden, overflow-x:hidden or overflow-y:hidden, and the element's location as determined by getClientRects is not within the fixed size of the parent.
- Essentially, this attempts to model whether or not a user of the browser could possibly find a way to view the WebElement without resizing the browser window.
-
- The common usage pattern for isDisplayed is typically something similar to (in python):
- element = driver.find_element(by = TAG_NAME, value= = "button") - if element.is_displayed(): - element.click() - else - # So other deep magic of the unseen ages. --
If isDisplayed returns true, then the element MUST also be
- interactable should it meet the other criteria for being interactable. If any part of the BODY can be brought into the current viewport, this MUST return true.
-
This implies that isDisplayed MUST return true if the centre of the element could be brought into the viewport. The exception to this would be the BODY element, which is generally assumed to always be displayed by users of the WebDriver spec. It is possible to interact with elements which may not have the centre point brought into the viewport by using the low level commands. This means that if any part of the element could be brought into the viewport by user action and its position could be used by low-level commands then a WebDriver implementation MAY return true.
If the ELEMENT does not represent a Document element, or it represents a Document element that is no longer attached to the document's node tree, then the WebDriver implementation MUST immediately abort the command and return a stale element reference error. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
+
The command is used to determine the element
+ visibility of the Document element
+ connected with the web element reference given by
+ the element fragment in the path.
+
+
The response is composed using the following algorithm:
+ +element fragment from the path.
+
+
| HTTP Method | Path Template | Notes | /session/{sessionId}/element/{ELEMENT}/selected |
|---|
The remote end MUST determine whether a WebElement is selected using the following algorithm:
selectable", the WebElement is not selected. A selectable element is either an OPTION element or an INPUT element of type "checkbox" or "radio".If ELEMENT does not represent a Document element, or it represents a Document element that is no longer attached to the document's node tree, then the WebDriver implementation MUST immediately abort the command and return a stale element reference error. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
| HTTP Method | @@ -104,17 +123,17 @@Notes | |
|---|---|---|
| GET | /session/{sessionId}/element/{ELEMENT}/attribute/{name} |
Although the [[!html51]] spec is very clear about the difference between the properties and attributes of a Document element, users are frequently confused between the two. Because of this, the WebDriver API offers a single command ("getElementAttribute") which covers the case of returning either of the value of a Document element property or attribute. If a user wishes to refer specifically to an attribute or a property, they should evaluate Javascript in order to be unambiguous.
Although the [[!HTML51]] spec is very clear about the difference between the properties and attributes of a Document element, users are frequently confused between the two. Because of this, the WebDriver API offers a single command ("getElementAttribute") which covers the case of returning either of the value of a Document element property or attribute. If a user wishes to refer specifically to an attribute or a property, they should evaluate Javascript in order to be unambiguous.
The algorithm to implement this MUST be (where name refers to the name parameter of the getElementAttribute command):
name case insensitively matches "style", the value returned MUST be serialized as defined in the [[!CSSOM-VIEW]] spec. Notably, css property names MUST be cased the same as specified in in section 6.5.1 of the [[!CSSOM-VIEW]] spec.
@@ -331,17 +350,17 @@
GET
/session/{sessionId}/element/{ELEMENT}/enabled
The "isEnabled" command MUST return false if all the following criteria are met otherwise return true:
disabled boolean attribute as described in disabled elements of [[!html51]]disabled boolean attribute as described in disabled elements of [[!HTML51]]If the ELEMENT does not represent a Document element, or it represents a Document element that is no longer attached to the document node tree, then the WebDriver implementation MUST immediately abort the command and return a stale element reference error. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
This section describes the interaction with
cookies
- as described in the HTML Specification ([[!html51]]). When retrieving
+ as described in the HTML Specification ([[!HTML51]]). When retrieving
and setting a cookie it MUST be in the format of a Cookie.
Conformance tests for this section can be found in the webdriver module under the "cookies" folder.
When returning Cookie objects, the server SHOULD include all optional fields it is capable of providing the information for.
Some user actions require the element to be interactable. The following conditions must be met for the element to be considered interactable:
A requirement for key-based interaction with an element is that it is interactable. Typing into an element is permitted if one of the following conditions is met:
activeElement. In
addition to focusable elements, this allows typing to the BODY element.contentEditable attribute set or the containing document is in designMode.Prior to any keyboard interaction, an attempt to shift focus to the element MUST be attempted if the element does not currently have the focus. This is the case if one of the following holds:
activeElement.In case focusing is needed, the implementation MUST follow the focusing steps as described in the focus management section of the [[!html51]] spec. The focus MUST NOT leave the element at the end of the interaction, other than as a result of the interaction itself (i.e. when the tab key is sent). +
In case focusing is needed, the implementation MUST follow the focusing steps as described in the focus management section of the [[!HTML51]] spec. The focus MUST NOT leave the element at the end of the interaction, other than as a result of the interaction itself (i.e. when the tab key is sent).
The IDL fragments in this specification must be interpreted as required for conforming IDL fragments, as described in the Web IDL specification [[!WEBIDL]].
This specification describes the conformance criteria for both local (relevant to creating bindings for languages) and remote end implementations (relevant to browser vendors and server implementors). A final conformance class — intermediate node — is also specified. These represent those nodes situated between the local and remote ends.
In equations, all numbers are integers, subtraction is + represented by “−”, and bitwise OR by “|”. The characters “(” + and “)” are used to provide logical grouping in these contexts. +
When asked to normalize style pixel values to integer + for a value s: + +
When asked to normalize style pixel values to floating + point for a value s: + +
ceil so that
+ it has no more than four decimals.
+
+ These operations are almost equivalent to calling
+ parseInt
+ and parseFloat
+ from [[!ECMA-262]] with the exception that non-valid integer
+ or float return values are returned as 0 or 0.0.
+
The communication between the remote and local ends is performed via Command and Response objects. How these are encoded and transmitted between the remote and local ends is left undefined.
interface Command {
@@ -625,18 +683,18 @@ A Command instance MUST be
GET
/session/{sessionId}/url
WebDriver implementations MUST allow the users to be able to get the
- current URL. In the case of a Nested Browsing Context WebDriver MUST return the URL of the [[html51]] top level browsing context.
- It is the equivalent to returning document.location.href for the [[html51]] top level browsing context.
+ current URL. In the case of a Nested Browsing Context WebDriver MUST return the URL of the [[!HTML51]] top level browsing context.
+ It is the equivalent to returning document.location.href for the [[!HTML51]] top level browsing context.
If the page takes too long as specified by the timeouts a timeout error MUST be raised. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
| Notes | ||
|---|---|---|
| POST | /session/{sessionId}/back |
The "goBack" command is equivalent to a user hitting the "back" button in their browser, and MUST behave as a traversal of the browser history by a delta of -1 (as defined in [[!html51]]). If a user calls "goBack" when there are no further pages in the browser's history stack, then this call MUST be a no-op.
+
The "goBack" command is equivalent to a user hitting the "back" button in their browser, and MUST behave as a traversal of the browser history by a delta of -1 (as defined in [[!HTML51]]). If a user calls "goBack" when there are no further pages in the browser's history stack, then this call MUST be a no-op.
If the page takes too long as specified by the timeouts a timeout error MUST be raised. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
| HTTP Method | @@ -663,17 +721,17 @@ ANotes | |
|---|---|---|
| POST | /session/{sessionId}/forward |
The "goForward" command is equivalent to a user hitting the "forward" button in their browser, and MUST behave as a traversal of the browser history by a delta of +1 (as defined in [[!html51]]). If a user calls "goForward" when there are no further pages in the browser's history stack, then this call MUST be a no-op.
+
The "goForward" command is equivalent to a user hitting the "forward" button in their browser, and MUST behave as a traversal of the browser history by a delta of +1 (as defined in [[!HTML51]]). If a user calls "goForward" when there are no further pages in the browser's history stack, then this call MUST be a no-op.
If the page takes too long as specified by the timeouts a timeout error MUST be raised. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
| POST | /session/{sessionId}/title |
- The "getTitle" command MUST return the contents of the <title> element like it would for document.title. In the case of a Nested Browsing Context WebDriver MUST return the title of the [[html51]] top level browsering context.
+ The "getTitle" command MUST return the contents of the <title> element like it would for document.title. In the case of a Nested Browsing Context WebDriver MUST return the title of the [[HTML51]] top level browsering context.
If the page takes too long as specified by the timeouts a timeout error MUST be raised. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
Command instance MUST be
Within this specification, a window equates to [[!html51]]'s top level browsing context. Put another way, within this spec browser tabs are counted as separate windows.
+Within this specification, a window equates to [[!HTML51]]'s top level browsing context. Put another way, within this spec browser tabs are counted as separate windows.
TODO: define "frame"
A Window Handow is an opaque string that MUST uniquely identify the top level browsing context and MUST NOT be "current". This MAY be a UUID.
Command instance MUST be
Web applications can be composed of multiple top level browsing context and/or frames. For a normal user, the context in which an operation is performed is obvious: it's the window or frame that currently has OS focus and which has just received user input. The WebDriver API does not follow this convention. There is an expectation that many browsers using the WebDriver API may be used at the same time on the same machine. This section describes how WebDriver tracks which window or frame is currently the context in which commands are being executed.
WebDriver's default content is [[!html51]]'s top level browsing context that is currently receiving WebDriver commands.
+WebDriver's default content is [[!HTML51]]'s top level browsing context that is currently receiving WebDriver commands.
When a WebDriver instance is started and a single OS window is opened, the default content of that OS window is automatically selected for receiving further commands. If more than one OS window or multiple top level browsing contexts are opened when the session starts, then the user MUST first select which top level browsing context to act upon using the switchToWindow command. Until the user selects a top level browsing context, all commands must return a status code of no such window.
Command instance MUST be
The "switchToParentFrame" command MUST set the context of future commands to the window.parent. If the current context is the [[!html51]]'s top level browsing context, the context remains unchanged.
The "switchToParentFrame" command MUST set the context of future commands to the window.parent. If the current context is the [[!HTML51]]'s top level browsing context, the context remains unchanged.
All browsers must comply with the focus section of - the [[!html51]] spec. In particular, the requirement that the active element within a top-level browsing + the [[!HTML51]] spec. In particular, the requirement that the active element within a top-level browsing context be independent of whether or not the top-level browsing context itself has system focus MUST be followed.
This requirement is put in place to allow efficient machine utilization when using the WebDriver API to control several browsers independently on the same desktop
Command instance MUST be
result.append(element)
Where "search_term" is the link text being searched for, and "result" contains the list of elements to return.
Strategy name: xpath
-All WebDriver implementations MUST support finding elements by XPath 1.0 [[!XPATH]] with the edits from section 3.3 of the [[!html51]] specification made. If no native support is present in the browser, a pure JS implementation MAY be used. When called, the returned values MUST be equivalent of calling "evaluate" function from [[DOM-LEVEL-3-XPATH]] with the result type set to "ORDERED_NODE_SNAPSHOT_TYPE (7).
+All WebDriver implementations MUST support finding elements by XPath 1.0 [[!XPATH]] with the edits from section 3.3 of the [[!HTML51]] specification made. If no native support is present in the browser, a pure JS implementation MAY be used. When called, the returned values MUST be equivalent of calling "evaluate" function from [[DOM-LEVEL-3-XPATH]] with the result type set to "ORDERED_NODE_SNAPSHOT_TYPE (7).
The visibility of a Document element
+ is guided by what is perceptually visible to the human eye.
+ An element's visibility does in this context thus not relate
+ in any way to the visibility
+ or display
+ style properties [[!CSS3BOX]].
+
+
The approach used by WebDriver to ascertain an element's + visibility is based on crude approximations about the element's + nature and relationship in the tree. An element is in general + to be considered visible if any part of it is drawn on the + canvas within the bounderies of the viewport. + +
An element's element visibility + is a boolean state where true signifies visibility and false + invisibility. To compute the state on element: + +
hidden is set, return false.
+
+ display style
+ property is "none", return false.
+
+
+ document.documentElement:
+
+ background-color
+ property is "transparent", run these substeps:
+
+ HTML
+ element [[!HTML51]], and the computed value of the
+ background-color style property of the first
+ BODY element descendant of the element in
+ tree
+ order, relative to that element, is also "transparent",
+ return false.
+
+ option or
+ optgroup element:
+
+ select element,
+ return the result of applying the element visibility
+ algorithm on it if its result is false.
+ map element, run
+ these substeps:
+
+ img element, image element
+ in the document with a name attribute matching
+ the value of element's usemap
+ attribute, run these substeps:
+
+ area element:
+
+ map element,
+ apply the element visibility algorithm on it.
+
+ getBoundingClientRect on
+ child.
+
+ height property of
+ rectangle is
+ greater than zero CSS pixels, and the value of the
+ width property of rectangle is
+ greater than zero CSS pixels:
+
+ overflow-x or
+ overflow-y is "hidden":
+
+ DOMRect
+ that is the first element of the DOMRectList
+ array returned by calling getClientRects
+ on parent.
+
+ DOMRect
+ that is the first element of the DOMRectList
+ array returned by calling getClientRects
+ on element.
+
+ top
+ is less than (parent dimension's bottom
+ − the normalized style pixel float value of parent
+ style's borderBottomWidth).
+
+ bottom
+ is less than (parent dimension's top
+ − the normalized style pixel float value of parent
+ style's borderTopWidth).
+
+ left
+ is less than (parent dimension's right
+ − the normalized style pixel float value of parent
+ style's borderRightWidth casted as a
+ float).
+
+ right
+ is less than (parent dimension's left
+ − the normalized style pixel float value of parent
+ style's borderLeftWidth casted as a
+ float).
+ If the steps above return true, then the element MUST also + be interactable should it + meet the other criteria for being interactable. If any part of + the BODY can be brought into the current viewport, the return + value MUST be true. +
Conformance tests for this section can be found in the webdriver module under the "element_state" folder.
Command instance MUST be
+
| HTTP Method | Path Template | Notes | |
|---|---|---|---|
| GET | -/session/{sessionId}/element/{ELEMENT}/displayed | +/session/{sessionId}/element/{element}/displayed |
The following steps MUST be used to determine if an element is displayed to a user.
-display:none in its computed CSS style.element.getBoundingClientRect()
- then it MUST be displayed.overflow:hidden, overflow-x:hidden or overflow-y:hidden, and the element's location as determined by getClientRects is not within the fixed size of the parent.
- Essentially, this attempts to model whether or not a user of the browser could possibly find a way to view the WebElement without resizing the browser window.
-
- The common usage pattern for isDisplayed is typically something similar to (in python):
- element = driver.find_element(by = TAG_NAME, value= = "button") - if element.is_displayed(): - element.click() - else - # So other deep magic of the unseen ages. --
If isDisplayed returns true, then the element MUST also be
- interactable should it meet the other criteria for being interactable. If any part of the BODY can be brought into the current viewport, this MUST return true.
-
This implies that isDisplayed MUST return true if the centre of the element could be brought into the viewport. The exception to this would be the BODY element, which is generally assumed to always be displayed by users of the WebDriver spec. It is possible to interact with elements which may not have the centre point brought into the viewport by using the low level commands. This means that if any part of the element could be brought into the viewport by user action and its position could be used by low-level commands then a WebDriver implementation MAY return true.
If the ELEMENT does not represent a Document element, or it represents a Document element that is no longer attached to the document's node tree, then the WebDriver implementation MUST immediately abort the command and return a stale element reference error. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
+
The command is used to determine the element
+ visibility of the Document element
+ connected with the web element reference given by
+ the element fragment in the path.
+
+
The response is composed using the following algorithm:
+ +element fragment from the path.
+
+
| HTTP Method | Path Template | Notes | /session/{sessionId}/element/{ELEMENT}/selected |
|---|
The remote end MUST determine whether a WebElement is selected using the following algorithm:
selectable", the WebElement is not selected. A selectable element is either an OPTION element or an INPUT element of type "checkbox" or "radio".If ELEMENT does not represent a Document element, or it represents a Document element that is no longer attached to the document's node tree, then the WebDriver implementation MUST immediately abort the command and return a stale element reference error. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
| HTTP Method | @@ -1241,17 +1538,17 @@ ANotes | |
|---|---|---|
| GET | /session/{sessionId}/element/{ELEMENT}/attribute/{name} |
Although the [[!html51]] spec is very clear about the difference between the properties and attributes of a Document element, users are frequently confused between the two. Because of this, the WebDriver API offers a single command ("getElementAttribute") which covers the case of returning either of the value of a Document element property or attribute. If a user wishes to refer specifically to an attribute or a property, they should evaluate Javascript in order to be unambiguous.
Although the [[!HTML51]] spec is very clear about the difference between the properties and attributes of a Document element, users are frequently confused between the two. Because of this, the WebDriver API offers a single command ("getElementAttribute") which covers the case of returning either of the value of a Document element property or attribute. If a user wishes to refer specifically to an attribute or a property, they should evaluate Javascript in order to be unambiguous.
The algorithm to implement this MUST be (where name refers to the name parameter of the getElementAttribute command):
name case insensitively matches "style", the value returned MUST be serialized as defined in the [[!CSSOM-VIEW]] spec. Notably, css property names MUST be cased the same as specified in in section 6.5.1 of the [[!CSSOM-VIEW]] spec.
@@ -1468,18 +1765,18 @@ ACommandinstance MUST beGET /session/{sessionId}/element/{ELEMENT}/enabled The "isEnabled" command MUST return false if all the following criteria are met otherwise return true:
disabled boolean attribute as described in disabled elements of [[!html51]]disabled boolean attribute as described in disabled elements of [[!HTML51]]If the ELEMENT does not represent a Document element, or it represents a Document element that is no longer attached to the document node tree, then the WebDriver implementation MUST immediately abort the command and return a stale element reference error. If the top level browsing context currently receiving commands is no longer open a no such window error MUST be raised.
Command instance MUST be
This section describes the interaction with
cookies
- as described in the HTML Specification ([[!html51]]). When retrieving
+ as described in the HTML Specification ([[!HTML51]]). When retrieving
and setting a cookie it MUST be in the format of a Cookie.
Conformance tests for this section can be found in the webdriver module under the "cookies" folder.
When returning Cookie objects, the server SHOULD include all optional fields it is capable of providing the information for.
Command instance MUST be
Some user actions require the element to be interactable. The following conditions must be met for the element to be considered interactable:
Command instance MUST be
A requirement for key-based interaction with an element is that it is interactable. Typing into an element is permitted if one of the following conditions is met:
activeElement. In
addition to focusable elements, this allows typing to the BODY element.contentEditable attribute set or the containing document is in designMode.Prior to any keyboard interaction, an attempt to shift focus to the element MUST be attempted if the element does not currently have the focus. This is the case if one of the following holds:
activeElement.In case focusing is needed, the implementation MUST follow the focusing steps as described in the focus management section of the [[!html51]] spec. The focus MUST NOT leave the element at the end of the interaction, other than as a result of the interaction itself (i.e. when the tab key is sent). +
In case focusing is needed, the implementation MUST follow the focusing steps as described in the focus management section of the [[!HTML51]] spec. The focus MUST NOT leave the element at the end of the interaction, other than as a result of the interaction itself (i.e. when the tab key is sent).
Command instance MUST be