Skip to main content
POST
Keyboard Type

Overview

Dispatches real keydown+keyup events one character at a time against the active page of a browser session. Works with any focused input — if selector is provided, the target element is focused (and optionally cleared) before typing.

Path Parameters

string
required
Browser session ID (UUID).

Body

string
required
Text to type. UTF-8 supported. Each character fires a native keydown+keyup pair so input/change/autocomplete listeners run.
string
Optional CSS selector to focus before typing. When omitted, keystrokes go to whatever element is currently focused.
integer
default:"5000"
How long to wait (ms) for the selector to become visible. Ignored when no selector is given.
boolean
default:"false"
When true, clears the field’s current value before typing. Safe default is false so typing appends.
integer
default:"40"
Base inter-key delay in milliseconds. Capped at 5000.

Example Request

Response

Success Response (200)

boolean
True when the keystrokes were dispatched successfully.
integer
Number of characters (UTF-8 code points) dispatched.
Example Response:

Error Responses

Notes

  • Composed input is not supported. CJK dead-key composition, emoji composition sequences, and similar composed input are typed character-by-character, not as composition events.
  • Existing value is preserved unless clear: true. Typing appends to the field’s current value. Set clear: true to overwrite.
  • Shadow-root and iframe targets aren’t addressable. If the element is inside a shadow root or cross-origin iframe, the selector must match the shadow host or the endpoint will return 404.