Downloads
Track downloads and verify completion inside the verification loop (e.g., download_completed("report.csv") / downloadCompleted("report.csv")).
This page covers:
- What download tracking captures (best-effort)
- How to verify completion deterministically
- Where download evidence shows up (trace/artifacts)
Downloads should be asserted, not assumed.
A browser agent can click “Download” and still fail to actually download the file. Treat downloads as a verifiable outcome.
Table of Contents
What gets tracked
Download capture is best-effort and depends on backend support, but the runtime tries to record:
- completed download filename (when available)
- completion timestamps and basic metadata (when available)
The goal is not “perfect file system introspection,” but a reliable signal you can use in assertions.
Verification predicate
Use the download predicate in a required assertion (or as a done gate).
from predicate import download_completed
# Gate step success on a specific file appearing as completed
runtime.assert(download_completed("report.csv"), "download_ok", required=True)Examples
Verify a download after a click
from predicate import click, download_completed
runtime.begin_step("Download report")
snap = await runtime.snapshot(limit=80)
# (Find the download button your preferred way, then click it)
click(browser, element_id)Debugging
If a download assertion fails:
- Inspect your trace step-by-step:
- Confirm the click actually triggered a download (some sites open a new tab, trigger a blob URL, or require an extra confirmation UI).
Related topics
- Agent Runtime — assertions and done gates
- Tracing — where download evidence shows up