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 pageshowhide
explore
- Runtime Startup11 questions
- Bundled Engines6 questions
- Launch Options5 questions
- Session Isolation10 questions
- Cookie and Storage Scope6 questions
- Pages and Popups4 questions
- Emulated Environment15 questions
- Device Descriptors5 questions
- Media and Locale6 questions
- Simulated Time4 questions
questions
page 2 of 2What can a Playwright device descriptor not reproduce about a real phone, and what does a green mobile project prove?
basics
~20 sA 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.
How would you weigh Playwright's bundled Chromium against a branded chrome or msedge channel for a booking suite?
basics
~20 sDefault 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.
How would you decide whether a Playwright suite may run every context with ignoreHTTPSErrors and bypassCSP enabled?
basics
~20 sPlaywright'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.
In Playwright, what still works on a context created with javaScriptEnabled: false?
basics
~20 sAlmost 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.
When is passing custom args or an executablePath to Playwright's launch justified, and what do you take on by doing it?
basics
~20 sRarely, 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.
Your team treats Playwright's emulated locale, colour scheme and offline mode as proof the booking site works there. Where does that emulation stop?
basics
~20 sIt 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.
showing 31–36 of 36