Testing / Playwright Interview questions
What is the difference between headless and headed mode?
These control whether the automated browser actually renders a visible window while a test runs.
| Headless | Headed |
| No visible browser UI | Full visible browser window |
| Generally faster, lower resource use | Slightly slower, more resource use |
| Default for CI pipelines | Common for local debugging |
Playwright runs headless by default. Switching to headed mode is done by passing an option at launch, or the --headed flag with the test runner:
npx playwright test --headed
Headed mode is mainly a debugging aid - watching the actual interactions can quickly reveal issues (like an unexpected popup or animation) that logs alone don't make obvious, but it's rarely used for actual CI execution because it adds overhead without adding coverage.
More Related questions...