Clicks and typing are simulated in the page with page script and DOM events,
not OS-level input: the mouse and the keyboard are never used. For key-by-key
input with modifiers, use actions. Paths follow
http://127.0.0.1:4445/{token}; see the
overview for the reply format and the errors.
Every command here takes the same path parameters, answers null, and answers
404 no such element or 404 stale element reference for an element the page
does not know or that is gone:
The current session’s id.
Element click#
POST /session/{sessionId}/element/{elementId}/click
Scrolls the element to the middle of the view at once (also when the page sets
scroll-behavior: smooth), checks that it is
displayed, focuses
it, and calls its click(). The page sees a click event, without pointer or
mouse down and up events before it (use actions
for those). Whether another element covers it is not checked.
null.
Errors
| Status | error | When |
|---|---|---|
| 400 | element not interactable | The element is not displayed (the element is not visible). |
Element clear#
POST /session/{sessionId}/element/{elementId}/clear
Sets the element’s value to the empty string (its text, for an editable
element) through the native value setter, which React and similar frameworks
watch, then fires input and change.
null.
Element send keys#
POST /session/{sessionId}/element/{elementId}/value
Focuses the element and adds the text at the end of its value (its text, for
an editable element) through the native value setter, then fires input and
change once. The page sees no key events for the text.
The WebDriver Enter key, \uE007, is taken out of the text: when the text
holds one, the element then gets keydown, keypress and keyup for Enter
and its form is submitted (requestSubmit). Other WebDriver key codes are not
read here; they are added as characters.
The text to type. Required unless value is given.
The older form: the text as an array of strings, joined. Read only when
text is missing.
null.
Errors
| Status | error | When |
|---|---|---|
| 400 | invalid argument | Neither text nor a value array (`text` is missing). |