Commands
Wire format for browser commands sent through the protocol.
Command structure
{
"type": "worker.command",
"id": "cmd_001",
"command": {
"action": "navigate",
...
}
}Actions
navigate
Navigate to a URL.
{ "action": "navigate", "url": "https://example.com" }click
Click an element.
{ "action": "click", "selector": "#login-button" }fill
Fill an input field.
{ "action": "fill", "selector": "#email", "value": "user@example.com" }select
Select a dropdown option.
{ "action": "select", "selector": "#country", "value": "US" }wait
Wait for a condition.
{ "action": "wait", "selector": ".dashboard" }evaluate
Execute JavaScript.
{ "action": "evaluate", "expression": "document.title" }Response format
{
"type": "client.command_response",
"id": "cmd_001",
"result": { ... },
"error": null
}Next steps
- Concepts: Commands — Higher-level overview
- Building a Worker — Use commands in practice
Last updated on