type
Types text into an input, textarea, or contenteditable element matched by CSS selector, firing real key events so page input handlers run. Optionally clears the field first and paces keystrokes.
Instructions
Type text into the first element matching a CSS selector in the session's active tab: waits up to timeout for it, clicks it to focus, then sends real key events for each character, so the page's input handlers fire. Use press_key afterwards for Enter or Tab, and press_key alone for single keys. clear empties the field first; without it, text is appended. delay paces the characters for pages that react to typing speed. It doesn't check that the element is editable: typing into a button or plain text reports success but changes nothing, so target an input, textarea or contenteditable element. Returns how many characters were typed. Fails if the selector matches nothing within timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to type. | |
| clear | No | Empty the field's current value before typing. Default false, which appends. | |
| delay | No | Milliseconds to pause after each character, for pages that react to typing speed. Default 0. | |
| timeout | No | Milliseconds to wait for `selector` to appear. Default 5000. | |
| selector | Yes | CSS selector of the input, textarea or editable element. | |
| sessionId | Yes | The id returned by open_browser_session. Errors if no open session has it. |