Build a Self-Running QA Testing Bot with the Computer Use API
Traditional UI tests rely on brittle selectors and snapshots that break with every layout change. A computer use agent sees what a human sees, clicks and types, and can assert real behavior. You send a task, the agent runs on a cloud VM, and you get events and a final status. This post shows how to wire up a self-running QA bot with the Coasty Computer Use API.
How the QA bot works
The server runs an agent on a cloud machine. The developer sends a task, optionally instructions, and a deadline. The agent steps through actions, capturing screens, predicting clicks or keystrokes, and reporting events. When the agent succeeds, fails, or times out, the status reflects the outcome. You can stream events with Server-Sent Events or poll GET /v1/runs/{id} for a summary.
#!/usr/bin/env bash
API_KEY=$(cat "$COASTY_API_KEY")
# Create a task run that opens a browser, navigates to the app,
# clicks 'Sign In', types credentials, and asserts the dashboard appears.
# The agent runs on a cloud machine with machine_id 'my-qa-machine'.
curl -s https://coasty.ai/v1/runs \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "my-qa-machine",
"task": "Open Chrome, go to https://myapp.com/login, click the Sign In button, type [email protected] and mypass123, then assert that the Dashboard header appears.",
"cua_version": "v4",
"max_steps": 100,
"deadline_seconds": 300,
"on_awaiting_human": "pause"
}' | jq .Key fields and pricing
- ●machine_id: ID of the cloud machine the agent runs on.
- ●task: Natural language prompt the agent follows.
- ●cua_version: v3 for standard runs, v4 for autonomous runs with a pass/fail verifier.
- ●max_steps: Upper bound on agent steps, prevents endless loops.
- ●deadline_seconds: Max runtime per run.
- ●on_awaiting_human: pause, fail, or cancel when the agent needs human input.
- ●webhook_url: Optional endpoint to receive final status and a Coasty-Signature HMAC header.
- ●Each agent step costs $0.05.
A single POST /v1/runs request can run a full QA session on a real machine.
Where this beats brittle automation
Selectors like data-testid or XPath break when a developer adds a new column to a table. A computer use agent reads the screen, identifies the Sign In button visually, and types into the correct input field. This works even if UI layout changes or the app uses dynamic IDs. The agent can also handle JavaScript modals, drag-and-drop flows, and text that appears only after an async request completes.
You now have a blueprint for a self-running QA bot that runs on a real desktop, clicks and types like a human, and reports success or failure. Extend the bot with workflows to orchestrate multiple test suites, and wire the webhook to your CI pipeline. Start building at https://coasty.ai/developers to get your API key.