You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1195,9 +1195,9 @@ const fs = require('fs');
1195
1195
- returns: <[Promise]> Promise which resolves when the element matching `selector` is successfully filled. The promise will be rejected if there is no element matching `selector`.
1196
1196
1197
1197
This method focuses the element and triggers an `input` event after filling.
1198
-
If there's no text `<input>`, `<textarea>` or `[contenteditable]` element matching `selector`, the method throws an error.
1198
+
If there's no text `<input>`, `<textarea>` or `[contenteditable]` element matching `selector`, the method throws an error. Note that you can pass an empty string to clear the input field.
1199
1199
1200
-
> **NOTE** Pass empty string as a value to clear the input field.
1200
+
To send fine-grained keyboard events, use [`page.type`](#pagetypeselector-text-options).
1201
1201
1202
1202
Shortcut for [page.mainFrame().fill()](#framefillselector-value-options)
1203
1203
@@ -1585,7 +1585,7 @@ Shortcut for [page.mainFrame().title()](#frametitle).
1585
1585
-`timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
1586
1586
- returns: <[Promise]>
1587
1587
1588
-
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
1588
+
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.`page.type` can be used to send fine-grained keyboard events. To fill values in form fields, use [`page.fill`](#pagefillselector-value-options).
1589
1589
1590
1590
To press a special key, like `Control` or `ArrowDown`, use [`keyboard.press`](#keyboardpresskey-options).
-`timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
2281
2283
- returns: <[Promise]>
2282
2284
2283
-
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
2285
+
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.`frame.type` can be used to send fine-grained keyboard events. To fill values in form fields, use [`frame.fill`](#framefillselector-value-options).
2284
2286
2285
2287
To press a special key, like `Control` or `ArrowDown`, use [`keyboard.press`](#keyboardpresskey-options).
0 commit comments