skip to content

Browsers and Contexts

Launching the bundled engines and configuring the BrowserContext that owns a test's cookies, storage, permissions and emulated device. Asked because isolation is what keeps a suite fast.

on this pageshow

explore

questions

page 2 of 2

What can a Playwright device descriptor not reproduce about a real phone, and what does a green mobile project prove?

level: principalimportance: should knowfreq 36%

basics

~20 s

A descriptor overrides metrics, user agent and input flags inside a desktop engine. It reproduces no phone hardware, no shipping mobile browser and no mobile OS, so a green run proves your responsive layout works, not that iOS does.

open as a page

How would you weigh Playwright's bundled Chromium against a branded chrome or msedge channel for a booking suite?

level: principalimportance: should knowfreq 33%

basics

~20 s

Default to the bundled build: it is pinned to the Playwright version, reproducible everywhere and runs ahead of the stable browsers. Reach for a branded channel only where fidelity to the shipping product matters, and accept that it auto-updates.

open as a page

How would you decide whether a Playwright suite may run every context with ignoreHTTPSErrors and bypassCSP enabled?

level: principalimportance: should knowfreq 28%

basics

~20 s

Playwright's ignoreHTTPSErrors and bypassCSP are deliberate deviations from a real browser. Default both off, enable them only for the tests or environments that need it, and keep one path running with the real certificate and policy.

open as a page

In Playwright, what still works on a context created with javaScriptEnabled: false?

level: middleimportance: nice to knowfreq 33%

basics

~20 s

Almost everything Playwright drives. The page's own scripts never run, but navigation, clicks, filling fields, locators, assertions and Playwright's evaluate call all still work, because the driver talks to the browser over the protocol rather than through page script.

open as a page

When is passing custom args or an executablePath to Playwright's launch justified, and what do you take on by doing it?

level: principalimportance: nice to knowfreq 24%

basics

~20 s

Rarely, and only for a capability no supported option provides. Playwright computes a default argument set and supports the browsers it ships; every custom flag or foreign binary is a divergence your team owns, debugs and revisits at each upgrade.

open as a page

Your team treats Playwright's emulated locale, colour scheme and offline mode as proof the booking site works there. Where does that emulation stop?

level: principalimportance: nice to knowfreq 26%

basics

~20 s

It stops at what the page can observe. Playwright's context options substitute the values and media-query state the browser reports, so the right code branch runs; they do not reproduce a real device, font stack or network.

open as a page

showing 31–36 of 36