Overview
Fill input fields, textareas, and select elements with values. Uses React-compatible synthetic events to ensure proper state updates. Automatically waits for network stability unless disabled.Syntax
Arguments
CSS selector or numeric index from cached query results (0-based)
Value to fill into the field
Options
Element index if selector matches multiple (0-based)
Do not blur after filling (keeps focus on element)
Skip waiting for network stability after fill
Output as JSON
Behavior
Event sequence
- Focus: Dispatches
focusevent - Input: Sets value and dispatches React
inputevent withnativeEvent - Change: Dispatches React
changeevent - Blur (default): Removes focus with
blurevent - Wait (default): Waits for network stability
React compatibility
- Properly triggers
onChangehandlers in React components - Sets both DOM value and React internal state
- Uses
Object.getOwnPropertyDescriptorto update React’s tracked value
Automatic waiting
By default, waits for page stability after filling:- Network idle (no requests for 150ms)
- DOM stable (no mutations for 200ms)
- Maximum wait: 2 seconds
Examples
Fill by selector
Fill by cached index
Fill specific match
Keep focus after filling
Skip stability wait
Complete form workflow
Supported field types
Text inputs
Textareas
Select elements
Number inputs
Exit codes
Success - field filled
RESOURCE_NOT_FOUND - element not found
STALE_CACHE - cached index invalid (page navigation)
CDP_TIMEOUT - CDP operation timed out
Troubleshooting
Value not updating
For React components, ensure:- The component uses controlled inputs with
onChange - Try without
--no-blur(blur triggers validation) - Check for custom event handlers that may block updates
Slow filling
If fills are slow due to stability waiting:- Use
--no-waitfor fields without validation - Fill multiple fields before waiting for submission
Element not fillable
Comparison with other methods
| Method | Use case |
|---|---|
bdg dom fill | Form fields with React support |
bdg dom eval | Direct value setting without events |
bdg dom pressKey | Keyboard-based input |
Related commands
bdg dom form- Discover form structurebdg dom click- Click buttons and checkboxesbdg dom query- Find form fieldsbdg dom submit- Submit forms

