Build a Self-Running QA Testing Bot with the Computer Use API
QA that lives inside the browser or desktop app often breaks when UI changes. A self-running QA bot needs to see the screen, understand context, and act like a human. The Coasty Computer Use API lets you drive real desktops, browsers, and terminals by describing what to do with natural language. You start a task, stream events, and optionally cancel or resume. This guide shows how to build a minimal QA runner that logs into a demo app, clicks through a flow, and verifies a result.
How it works
A QA bot runs as a Task Run. You POST to /v1/runs with a machine_id, task description, and optional instructions. The server provisions a cloud VM, starts the agent, and drives the desktop until the task succeeds, fails, or times out. You GET /v1/runs/{id} to poll status, or stream events with GET /v1/runs/{id}/events to see actions live. If the human needs approval, you can configure on_awaiting_human to pause, fail, or cancel the run. Billing is $0.05 per agent step.
curl -X POST https://coasty.ai/v1/runs \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "machine_abc123",
"task": "Log into the demo app at https://example.com/login, navigate to the dashboard, and verify the welcome message.",
"cua_version": "v3",
"max_steps": 50,
"deadline_seconds": 300,
"on_awaiting_human": "pause",
"system_prompt": "You are an autonomous QA tester. Verify user flows and report failures."
}'Poll and stream task status
- ●GET /v1/runs returns a list of recent runs with id, status, created_at, and updated_at.
- ●GET /v1/runs/{id} shows the current status (queued, running, awaiting_human, succeeded, failed, cancelled, timed_out).
- ●GET /v1/runs/{id}/events streams Server-Sent Events and includes fields like event_type, message, and step_index.
- ●Reconnect with the Last-Event-ID header if the client disconnects.
curl -N -H "X-API-Key: $COASTY_API_KEY" \
https://coasty.ai/v1/runs/abc123/eventsStream events with GET /v1/runs/{id}/events to see actions live and handle human approval when on_awaiting_human is pause.
Where this beats brittle automation
Traditional QA relies on CSS selectors, XPath, or hardcoded IDs that break when a button moves or text changes. A computer use agent reads the screen, understands context, and clicks what it sees. It can handle dynamic UI, modals, tooltips, and multi-step flows without selector libraries. It also works on desktop apps and terminals, not just browsers. The result is more resilient tests that stay valid across releases.
You now have a self-running QA bot that logs into your app, follows real user flows, and reports outcomes using the Computer Use API. Add assertions, retries, and workflows to scale across environments. Get your API key at https://coasty.ai/developers and start automating with a computer use agent.