playwright failed when agent tried exporting the findings csv
Fixes Playwright failing when an agent tried exporting a findings CSV: prefer API export, then debug selectors. Use when CSV export automation breaks. Not for missing data.
TL;DR
UI CSV exports are brittle; if the platform offers an export API, use it. Otherwise, fix the Playwright flow by waiting on the right conditions and verifying the download event.
Error
playwright failed when agent tried exporting the findings csvSteps
- Check whether the platform offers a findings export API; use it if so. Expected: the stable path.
- If UI export is the only path, reproduce manually and note each step. Expected: the expected flow documented.
- Fix the Playwright script: wait for the export button to be actionable, then wait for the download event. Expected: deterministic export.
- Verify the downloaded CSV is complete (row counts, headers). Expected: proven export.
- Schedule the export API or a direct query as the long-term fix. Expected: no UI dependency.
When to use
- Playwright CSV export failures.
- Automating findings exports.
When not to use
- The data does not exist (fix the scan).
- API export available but unused (switch to it).
Tool compatibility
- Playwright; download events; export APIs.
Variant phrasings
playwright csv export failed
Wait on download.
findings export broke
Prefer the API.
Why it happens
Export UIs change, downloads race with navigation, and headless timing differs from headed.
Edge cases
- Large exports paginate; the CSV may need multiple pulls.
- Downloads in headless mode need the download path configured.
- Verify exports after every platform upgrade.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_I2cjKfgmLM19JYB-YqYSlw