Playwright codegen records against HTTP-authenticated pages
Introduced 2026-09-04 · score 0.97
HOW TO USE IT
When recording tests for an HTTP Basic Authentication page, run `codegen` with `--http-credentials="username:password"` and the page URL. Credentials are sent to any origin that requests them during recording and are included in generated code.
npx playwright codegen --http-credentials="<username>:<password>" <url>WHY THIS HELPS
Generate test code for a page protected by HTTP authentication.
REQUIREMENTS AND LIMITATIONS
- Version: v1.63.0
- --http-credentials (required): HTTP Basic Authentication credentials in `username:password` form; sent to any origin that requests them during recording and included in generated code.
- <url>: Website URL to generate tests for; may be omitted and entered in the browser instead.
FIRST-PARTY EVIDENCE
- https://github.com/microsoft/playwright/releases/tag/v1.63.0
- https://github.com/microsoft/playwright/blob/v1.63.0/docs/src/codegen.md
Check the installed version and the source before using it. Entry JSON