Real browsers

Drive Chromium, Firefox, and WebKit through Playwright's own driver, from PHP. Test rendering, JavaScript, network, and browser behavior without moving the suite to a JavaScript test runner.

  • Architecture PHP drives the same Playwright browser process
  • Three engines One script, three rendering engines
  • Isolation Fresh sessions without relaunching the browser
Architecture

PHP drives the same Playwright browser process

The PHP client sends each command to a local Node driver over a pipe. That driver owns the browser, while your test setup and assertions stay in PHP.

Architecture overview →
Three engines

One script, three rendering engines

Choose Chromium, Firefox, or WebKit when you create the context. The same page, locator, and assertion methods then drive each engine.

Browsers and contexts →
$chromium = Playwright::chromium();
$firefox  = Playwright::firefox();
$webkit   = Playwright::webkit();
Isolation

Fresh sessions without relaunching the browser

Each browser context carries its own cookies, storage, and permissions. Create a fresh context per test to isolate state while reusing the browser process.

Core concepts →
Next step

Move from the tour to working code.

Choose the explanation, recipe, or runnable example that matches what you need next.

Common questions

Before you wire it into a suite.

Does this use Selenium or WebDriver?
No. The PHP client talks to a local Node bridge, which uses Playwright to control Chromium, Firefox, or WebKit.
Should I launch a browser for every test?
Usually no. Launch one browser, then create fresh browser contexts for isolation. Contexts keep cookies and storage separate without paying the full browser startup cost each time.
Can one suite run on all browser engines?
Yes. Keep the scenario code independent from the engine and switch Chromium, Firefox, or WebKit at the launch layer.