Top 3 Playwright Interview Questions
Browse 3 real-world technical and behavioral interview questions about Playwright. Review scenarios, edge cases, and architectural best practices.
A Playwright test clicks a button that is visibly on screen, and roughly one run in twenty nothing happens. The button is server-rendered but the app hydrates after load. Why does the click get lost, and how do you fix the flake properly?
Playwright actionability checks pass on server-rendered markup because the element is attached, visible, stable and enabled - none of which imply React has attached its listener. The click lands on inert HTML, so this is a race with hydration, not a timing problem. Wait on a readiness signal the app exposes deliberately.
What does auto-waiting do in Playwright and Cypress, how do the two differ architecturally, and what can neither of them test?
Auto-waiting runs actionability checks before an action and retries assertions that are bound to a locator, so it removes timing races but never wrongness. Playwright drives the browser from a separate Node process.
How do you get a browser test into the state it needs to start, without clicking through the UI to get there?
Create the data through the API, restore an authenticated session from saved cookies and storage rather than logging in each time, and stub only the third parties you do not own, so each test drives the UI solely for the behaviour it is actually asserting.