Back to Blog
Tutorial

Priya Patel8 min
+L

Existing QA tools rely on selectors that break when UI changes. You can build a self-running QA bot that watches the screen, clicks, types, and checks results exactly like a human tester. The Coasty computer use API drives real desktops, browsers, and terminals instead of mocking them. This tutorial shows you how to set up a task run, watch events, and stop when the test succeeds or fails.

How it works

A QA bot is a task run that opens an application, navigates to a URL, fills a form, clicks a button, and asserts the expected outcome. The Coasty computer use API executes this on a real machine with a deployed machine_id. You POST /v1/runs with machine_id, task, and cua_version. Coasty then drives the machine step by step, sending events to your webhook or polling GET /v1/runs/{id}/events. The run ends when status is succeeded, failed, cancelled, or timed_out. Billed $0.05 per agent step.

bash
# Start a Chrome browser on a Coasty machine and run a QA test
export COASTY_API_KEY=your_key_here

# POST /v1/runs
curl -X POST https://coasty.ai/v1/runs \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "chrome-browser",
    "task": "Open https://example.com, type "Hello" in the search box, press Enter, and verify the title contains "Example Domain". If not, fail the test.",
    "cua_version": "v4",
    "max_steps": 50,
    "deadline_seconds": 120,
    "on_awaiting_human": "pause"
  }'

Poll for run status

  • GET /v1/runs/{id} returns the current status and metadata.
  • GET /v1/runs/{id}/events streams Server-Sent Events for each step.
  • Reconnect GET /v1/runs/{id}/events with Last-Event-ID when you disconnect.
  • Status values include queued, running, awaiting_human, succeeded, failed, cancelled, timed_out.

A single run_id ties together the machine, the task, and the live events.

Where this beats brittle automation

Traditional E2E tools use XPath or CSS selectors that break when a class name changes. The computer use API watches the actual screen, responds to text, icons, and layout, and uses coordinates you receive from the API. This means your bot works even if the UI designers use different class names or reorganize the page. You can test real interactions like drag-and-drop, focus changes, context menus, and dynamic content that mocking frameworks cannot cover. The agent also handles unexpected states, such as network errors or alerts, instead of crashing your pipeline.

You now have the basics to build a self-running QA testing bot that drives real browsers, desktops, or terminals using the computer use API. Extend this by wrapping runs in workflows with assertions, retries, and parallel branches to cover complex test suites. Get a free API key at https://coasty.ai/developers and start automating your QA pipeline.

© 2026 Coasty

Backed byYCombinator