How to Use This List
These are the Playwright questions that actually come up, grouped by topic. Each answer is the short version — follow the link for the full explanation. For the complete learning path, start with the Complete Playwright Guide.
Fundamentals (Q1–5)
1. What is Playwright? A modern open-source browser-automation framework developed by Microsoft, supporting multiple browsers and languages with built-in auto-waiting. → Fundamentals
2. Why use Playwright over older tools? Speed, reliability, built-in auto-wait (far less flakiness), a built-in test runner, and API/network testing in the same framework. → Fundamentals
3. Which browsers and languages does Playwright support? Chromium, Firefox, and WebKit; with JavaScript/TypeScript, Python, Java, and .NET bindings. → Fundamentals
4. What's the difference between headless and headed mode? Headless runs without a visible browser UI (faster, standard for CI); headed shows the browser (useful for debugging). → Fundamentals
5. How is Playwright different from Selenium? Playwright auto-waits and connects to browsers directly; Selenium needs manual waits and goes via WebDriver drivers. → Selenium vs Playwright
Auto-Wait & Synchronization (Q6–9) ⭐
6. What is auto-wait? Playwright automatically waits for elements to be actionable before interacting — the single biggest reason it's less flaky than Selenium. → Auto-Wait
7. What does Playwright automatically wait for? That the element is attached, visible, stable, enabled, and receives events — plus navigation and network conditions. → Auto-Wait
8. What's the difference between waitForTimeout and waitForSelector? waitForTimeout is a hard-coded pause (avoid it); waitForSelector waits for a specific condition — the reliable option. → Auto-Wait
9. Do you still need explicit waits in Playwright? Rarely — auto-wait covers most cases. Use explicit waits only for custom conditions auto-wait can't infer. → Auto-Wait
Locators & Actions (Q10–12)
10. What locators does Playwright recommend? User-facing locators — getByRole, getByText, getByLabel, getByTestId — over brittle CSS/XPath. → Locators & Actions
11. What is locator strictness? If a locator matches multiple elements, Playwright throws rather than guessing — forcing you to write unambiguous locators. → Locators & Actions
12. How do you handle alerts and multiple windows/tabs? Dialog handlers for alerts; new pages/contexts for tabs and windows. → Alerts & Windows
Test Runner (Q13–15)
13. What is test.describe() used for? Grouping related tests into a block, with shared hooks and configuration. → Test Runner
14. How do you run tests in parallel? The runner parallelizes by default across workers — control it with the workers setting and fullyParallel. → Test Runner
15. What's the difference between test.only(), test.skip(), and test.fixme()? only runs just that test; skip skips it; fixme marks it as known-broken. → Test Runner
Auth & API (Q16–18) ⭐
16. What is storage state, and why does it matter? It saves the authenticated session (cookies + local storage) so you log in once and reuse it across tests — a big speed win. → Storage State
17. What's the difference between cookies and local storage? Cookies are sent to the server with requests and can expire; local storage is client-side only and persists until cleared. → Storage State
18. Can Playwright test APIs and mock network calls? Yes — it has built-in API request support and network interception/mocking, so you can stub backends in UI tests. → API & Network
Debugging & Architecture (Q19–20)
19. What is the trace viewer? A post-run debugging tool showing a timeline, DOM snapshots, actions, and network for every step — Playwright's standout debugging feature. → Reports & Debugging
20. How does Playwright's architecture differ from Selenium's? Playwright talks to browsers directly over their debug protocols; Selenium sends commands through WebDriver drivers — which is why Playwright is faster. → Architecture
Next Steps
- Full learning path: Complete Playwright Guide
- The comparison: Selenium vs Playwright
- The JS underneath: JavaScript for Testers
- Interview prep: SDET Interview Guide