Type
typeEnters text character by character to trigger autocomplete and live search widgets that ignore bulk fill. Then verifies insertion and reports the value.
Instructions
Type text into an input, textarea or contenteditable one character at a time: keydown, keypress, beforeinput, a native-setter append, input and keyup for each character, appended at the end. Use it for autocomplete and search-as-you-type widgets, which react to per-character events that fill never sends. Afterwards it checks the field: ok is false when characters were not inserted (the page cancelled a key, or maxlength was reached), and the final value is reported (its length only for a password field). Events are synthetic, so a widget that checks event.isTrusted still will not react. Number, date and other non-text inputs are refused: use fill. Newlines and tabs are refused: use press_key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nth | No | Which match to type into, 0-based | |
| text | Yes | Text to type, up to 2000 characters | |
| clear | No | Empty the field first. Otherwise the text is appended to what is there. | |
| exact | No | For "text=" selectors, require the whole trimmed text to equal the label instead of containing it. No effect on CSS selectors. | |
| tab_id | No | Arc tab id from list_tabs. Omit to use this agent's current tab. A tool that changes a tab will not fall back to the tab the user is looking at, so pass this or call open_url first. | |
| delay_ms | No | Pause between characters, up to 250ms, for widgets that debounce. Runs on page timers, which a background tab throttles to about one per second, so use 0 there or switch_to_tab first. The whole text must fit in 25000ms. | |
| selector | Yes | CSS selector, or one of: "text=Some label" (visible text, case-insensitive substring, exact matches ranked first); "ref=e12" (a ref from snapshot, re-resolved if the page re-rendered); "role=button[name="Save"]" (ARIA or implicit role, name an exact match, or name~="sav" for a substring); "label=Email" (the control a label names); "placeholder=Search" |