Back to Blog
Tutorial

Michael Rodriguez8 min
Pg Up

Traditional QA bots rely on brittle selectors and hard-coding IDs. When a UI changes, the test breaks. The Coasty Computer Use API lets a computer use agent see the screen and act like a human. You can launch a task, loop through captures and predictions, and let the agent verify your web app until success or failure. This guide shows how to build a self-running QA testing bot with the real endpoints and prices from the API docs.

How the QA bot works

The bot starts by creating a task run with POST /v1/runs. Include the machine_id, the QA task description, the cua_version (v4 for autonomous with pass/fail verification), and optional instructions or a system prompt. The server provisions a cloud VM and launches the agent. The agent captures the screen, predicts the next action, and clicks or types. It repeats until the task succeeds, fails, times out, or is cancelled. You stream events from GET /v1/runs/{id}/events to see each step. Billing is $0.05 per agent step.

bash
#!/usr/bin/env bash
# Create a QA testing task with the Computer Use API
# Requires COASTY_API_KEY in your environment

TASK="Navigate to https://example.com, verify the page title contains 'Example Domain', and confirm the login form is present."

curl -s -X POST https://coasty.ai/v1/runs \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "$MACHINE_ID",
    "task": "'"$TASK"'",
    "cua_version": "v4",
    "instructions": "Run the QA test described in the task field."
  }' | jq .

Watch progress with streaming events

  • Use GET /v1/runs/{id}/events to stream Server-Sent Events.
  • Reconnect with the Last-Event-ID header on disconnects.
  • Each event includes step_id, action, status, and timestamp.
  • When status is succeeded or failed, the task is complete.
  • You can cancel or resume a run from the events stream.

One line to remember: POST /v1/runs creates a self-running QA task at $0.05 per agent step.

Where this beats brittle automation

A selector-based bot must know exactly which ID, class, or text to look for. If the team adds a new class name or moves a field, the test fails. With the Computer Use API, the agent sees the screen and clicks the element it can see. It handles layout changes, dynamic IDs, and ambiguous elements without you updating selectors. This makes tests more resilient and easier to maintain for fast-moving web apps.

You now have a blueprint for a self-running QA testing bot using the Coasty Computer Use API. Create tasks, stream events, and let the agent drive the browser until your test passes or fails. Get your API key at https://coasty.ai/developers and start automating full-page verification today.

© 2026 Coasty

Backed byYCombinator