Headless browser

A real browser engine running with no visible window. Same rendering and JavaScript, driven by a script instead of a person.

browser with no windowinvisible Chromeheadles browserrun tests without seeing the browserbrowser without a UIchrome running on the serverthe thing puppeteer controlsscreenshot a page from a script

See it

Live demo coming soon

What it is

A headless browser is a real browser engine (Chromium, Firefox, WebKit) running with the window turned off. It still parses HTML, applies CSS, runs JavaScript, fires events, and paints pages internally; you just drive it from code instead of a mouse, through Playwright, Puppeteer, or Selenium. That is why it is the engine under end-to-end tests, and also under screenshot services, PDF generation, Open Graph image rendering, and scraping of JavaScript-heavy pages.

You reach for headless mainly because of CI: a build server has no display, and skipping the window makes runs faster and lets you run many browsers in parallel. The workflow that actually works is headless by default, headed when you are debugging: run the same spec with --headed, slow it down, or open the Playwright trace viewer to step through a CI failure frame by frame.

Gotchas cluster around 'headless is not quite headed'. A container usually has none of your fonts, so text renders in a fallback and screenshots differ from your laptop. There is often no GPU, so canvas and WebGL take a software path. The default viewport is small, so a responsive layout may be in its mobile branch when you assumed desktop. And some sites fingerprint headless browsers and serve them a captcha or a blank page. If a test passes headless and fails headed (or the reverse), suspect fonts, viewport, animation timing, or a permission prompt before you suspect your code.

Ask AI for it

Set up headless browser testing for this app with Playwright. Add a config that runs Chromium, Firefox, and WebKit headless by default with a fixed viewport (1280x720), a webServer block that boots the dev server before the run, retries in CI only, and trace, screenshot, and video captured on first retry. Write one smoke spec that loads the home page, asserts the main heading by role, and navigates to [KEY PAGE]. Add npm scripts for headless (CI), headed and --debug (local debugging), and trace viewing. Then add the CI job, including the browser install step and the fonts needed so screenshots match locally rendered text.

You might have meant

end to end testvisual regression testcross browser testingtest runnertest locator test id

Go deeper