Skip to content
SDETRole
SDETRole

Interview questions / UI Automation

Playwright Interview Questions

Playwright interviews centre on locators, auto-waiting, web-first assertions, fixtures and parallelism. These questions mirror what senior SDETs are asked in 2026.

9 questions · 2 beginner· 5 intermediate· 2 advanced

beginner questions

intermediate questions

advanced questions

How Playwright interviews are structured

For junior and mid-level roles, expect concept questions first: how auto-waiting works, why getByRole is preferred, the difference between a Browser, a BrowserContext and a Page. Senior interviews move quickly to design and debugging: how you would share authentication across hundreds of tests, how you would shard a suite across CI machines, and what you would do with a test that fails one run in twenty. Many loops also include a live exercise where you write a short spec or fix a broken one.

What interviewers listen for

  • Precise vocabulary. "Auto-waiting" covers actionability checks before actions (attached, visible, stable, enabled, receives events); retrying assertions are a separate mechanism. Candidates who blur the two struggle to explain flaky tests.
  • Isolation. Each test gets a fresh browser context, so cookies and storage do not leak. Strong answers explain how storage state keeps that isolation while skipping the UI login.
  • Restraint with mocking. Network mocking with page.route is valuable for error states and slow responses, but a suite that mocks everything no longer tests the integration.
  • A debugging method, not a guess. For a test that fails only in CI, describe reproducing with retries and traces, reading the trace viewer, and fixing the race rather than adding waitForTimeout.

A worked example: the one-line anti-pattern

A favourite question shows expect(await page.locator('#status').textContent()).toBe('Paid') and asks what is wrong. The await reads the text once, immediately; if the status updates a moment later, the assertion fails. The web-first version, await expect(page.locator('#status')).toHaveText('Paid'), retries until the text matches or the assertion timeout expires. A complete answer adds that a role-based locator such as page.getByRole('status') would also be more robust than an id, and that the same reasoning applies to isVisible() checks. The full model answer is in web-first assertions.

Fixtures, parallelism and scale

Senior Playwright interviews often turn to suite architecture. Fixtures are Playwright's dependency-injection mechanism: test.extend defines a value such as a logged-in page or an API client, sets it up before the test that asks for it, and tears it down afterwards, so setup lives in one place instead of beforeEach blocks copied across files. Worker-scoped fixtures run once per worker process, which suits expensive setup such as seeding a database.

For parallelism and sharding, explain the two levels: workers run test files in parallel on one machine, and --shard=1/4 splits the suite across CI machines, with the blob reporter and merge-reports combining the results. Parallel runs only work if tests do not share data, so a good answer mentions unique test data per worker.

How to practise

Read each question and answer it aloud before revealing the model answer, then practise the skill in the Playwright practice lab: locator challenges show exactly what your locator matches, and test challenges run your spec against a demo app with planted bugs that your assertions must catch. When the concepts feel solid, take a timed mock interview with the Playwright stack selected.

Type to search across SDETRole.

Full-text search by Pagefind · runs in your browser Open search page →