Tutorial

Build a Self-Running QA Testing Bot with the Computer Use API

Sarah Chen||10 min
Ctrl+S

Traditional test automation relies on brittle selectors or API mocks. When the UI changes, your tests break. With the Coasty Computer Use API, you build a self-running QA bot that can see the screen, interpret instructions, and click buttons just like a human. It works on real browsers, terminals, and desktop apps, not just API calls. You start a task run, feed it a test description, and the agent executes the test for you.

How a QA bot with Computer Use works

A QA bot runs as a Task Run. You POST to /v1/runs with your machine ID, the test task description, and configuration like the CU version, maximum steps, deadline, and what to do when the agent needs human input. The server drives a real desktop or browser, takes screenshots, and calls the prediction endpoint to decide the next action. The run streams events so you can track progress in real time. When the agent finishes, the status is succeeded, failed, or cancelled. Each agent step costs $0.05, and billing comes from a prepaid wallet (1 credit is $0.01).

bash
curl -X POST https://coasty.ai/v1/runs \
  -H "Authorization: Bearer $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "machine-123",
    "task": "Navigate to https://example.com, click the login button, enter a username and password, and verify the dashboard loads",
    "cua_version": "v3",
    "max_steps": 50,
    "deadline_seconds": 120,
    "on_awaiting_human": "pause"
  }'

Key QA bot configuration options

  • machine_id: ID of a provisioned cloud VM with a desktop or browser.
  • task: Natural language description of the QA test steps.
  • cua_version: Use "v3" for guided runs or "v4" for autonomous runs with automatic pass/fail verification.
  • max_steps: Limit how many agent actions can execute before the run fails.
  • deadline_seconds: Abort if the test does not complete within this duration.
  • on_awaiting_human: Pause, fail, or cancel the run when the agent encounters a human-only step.

POST /v1/runs starts the agent, each step is $0.05, and you monitor progress with streamed events.

Where this beats brittle automation

A computer use agent does not need to know the exact class name of a button or the ID of a DOM element. It looks at the screenshot, understands the context, and clicks the right control. This means your QA tests survive layout changes, new classes, or rebranding. You can also test real browser behavior, native dialogs, and desktop tools that lack stable APIs. No more flaky selectors or fragile mocks.

You can now build self-running QA bots that navigate real apps, click buttons, and verify outcomes without brittle selectors. Try it yourself by provisioning a machine, defining a test task, and starting a run with POST /v1/runs. Get your API key at https://coasty.ai/developers and let your QA bot take over repetitive tests.

Want to see this in action?

View Case Studies
Try Coasty Free