Skip to content

Commit 0a3677d

Browse files
authored
Merge pull request #105 from catchpoint/mouseclick_keypress_mod_support
Add documentation for mouse click and keypress modifier
2 parents 48da8b0 + 0248d08 commit 0a3677d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/scripting.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,28 @@ example: type Hello World
249249

250250
For the difference between `type` and `typeAndWait`, see [`click`](#click) and [`clickAndWait`](#clickandwait).
251251

252+
#### `mouseClick` / `mouseClickAndWait`
253+
Simulate a trusted mouse click event for the indicated element.
254+
Browser Support: Chrome
255+
```markup
256+
usage: mouseClick <wpt-selector> [<button>]
257+
example: mouseClick innerText=Send
258+
259+
<wpt-selector> - DOM element to send the click event to
260+
<button> - optionally specify mouse button, supported values: left|right|double
261+
```
262+
263+
For the list of supported selectors, see [Selectors](#selectors).
264+
252265
#### `keypress` / `keypressAndWait`
253266
Simulate a keyboard keypress for the given key.
254267
Browser Support: Chrome
255268
```markup
256-
usage: keypress <key>
269+
usage: keypress <key> [<modifier>]
257270
example: keypress Enter
258271
259272
<key> - Keyboard key to simulate pressing. Full list of supported keys is [here](https://github.com/WPO-Foundation/wptagent/blob/master/internal/support/keys.json).
273+
<modifier> - optionally specify keypress modifier, supported values: Alt|Ctrl|Shift
260274
```
261275

262276
For the difference between `keypress` and `keypressAndWait`, see [`click`](#click) and [`clickAndWait`](#clickandwait).

0 commit comments

Comments
 (0)