Build a Self-Running QA Testing Bot with the Computer Use API
Most QA tools rely on fragile selectors and undocumented API endpoints. When a product changes a class name or hides a button, your tests break. You need a bot that can see the screen, understand context, and act like a human tester. The Coasty Computer Use API lets you build self-running QA testing bots that drive browsers and desktops directly. The server drives an agent to completion for you with built-in state and events.
How the Computer Use API drives a QA test run
A QA test run is a full workflow that starts a browser, navigates, interacts with elements, and validates results. The Computer Use API handles this via task runs. You POST to /v1/runs with your machine ID, the QA task (like 'navigate to login page, fill credentials, verify dashboard loads'), and optional instructions. The API returns a run ID. You poll GET /v1/runs/{id} or stream events. The server bills $0.05 per agent step. The run state moves through queued, running, awaiting_human, succeeded, failed, cancelled, or timed_out. You can cancel or resume a run at any time. This is the simplest way to get a full test execution.
#!/bin/bash
export COASTY_API_KEY="${COASTY_API_KEY}"
# Start a cloud machine for QA testing
MACHINE_RESPONSE=$(curl -s -X POST https://coasty.ai/v1/machines \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "qa-workspace",
"image": "ubuntu-22.04"
}')
MACHINE_ID=$(echo "$MACHINE_RESPONSE" | jq -r '.machine_id')
# Create a QA test run (browser-based)
RUN_RESPONSE=$(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": "navigate to https://example.com/login, fill username and password, click login, verify success message appears",
"cua_version": "v3",
"max_steps": 50,
"on_awaiting_human": "pause"
}')
RUN_ID=$(echo "$RUN_RESPONSE" | jq -r '.run_id')
echo "QA run created with ID: $RUN_ID"
# Stream run events to watch progress
curl -s -N "https://coasty.ai/v1/runs/$RUN_ID/events" \
-H "X-API-Key: $COASTY_API_KEY" \
--no-buffer | jq -r '.event | .type' | while read -r TYPE; do
echo "Event: $TYPE"
done
# Check final status
STATUS=$(curl -s -X GET "https://coasty.ai/v1/runs/$RUN_ID" \
-H "X-API-Key: $COASTY_API_KEY" | jq -r '.status')
echo "QA run status: $STATUS"Key options for QA workflows
- ●machine_id: required, provisioned via POST /v1/machines. The QA bot drives the real desktop or browser inside this VM.
- ●task: natural language prompt that describes the full QA workflow. The agent plans steps and executes them.
- ●cua_version: use 'v3' for default behavior or 'v4' for an autonomous agent with an automatic pass/fail verifier.
- ●max_steps: limit steps to avoid runaway test runs. Each step costs $0.05.
- ●deadline_seconds: stop the run if it exceeds this time. Prevents testing from blocking pipelines indefinitely.
- ●on_awaiting_human: when the agent needs someone to interact, pause the run, fail it, or cancel it.
- ●webhook_url: notify your CI system when the run finishes. The webhook payload contains the final status and output.
A QA run bills $0.05 per agent step and you can stream events to watch progress in real time.
Where this beats brittle automation
Traditional QA tools rely on fixed selectors like class names, IDs, or XPath expressions. When developers refactor UI elements, tests break unless you constantly maintain selector maps. The Computer Use API lets your bot see the screen and click based on context. It can detect a button by its label, a dialog by its title, or a success message by the surrounding text. This works across browsers and operating systems without needing per-platform selectors. The server manages state and events, so you can pause, resume, or cancel long-running test suites. You get a single endpoint to orchestrate entire QA workflows without brittle selectors.
You can now build self-running QA testing bots with the Computer Use API. Start by provisioning a cloud machine, submitting a QA task, and streaming events to track progress. The API handles the complexity of screen perception and action execution for you. Ready to write your first QA bot? Get an API key at https://coasty.ai/developers and start automating real workflows today.