Whether you are preparing for an SDET interview, studying for a Playwright certification, or just want to test how well you actually know the framework, practice questions are the fastest way to find out. Active recall — forcing yourself to retrieve an answer before reading the explanation — has been shown to improve long-term retention by 2–3x compared to passively reviewing documentation.
The 20 questions below are organized by topic: locators, assertions, auto-waiting, fixtures & configuration, API testing, network interception, parallel execution, and CI/CD. Try answering each one before expanding the answer. At the end, tally your score to see where you stand.
Locators (Questions 1–4)
page.getByRole() is Playwright's recommended locator strategy. It queries the accessibility tree rather than the DOM, making tests more resilient to markup changes. You can also pass a second argument for name filtering: page.getByRole('button', { name: 'Submit' }).data-testid attribute?page.locator('[data-testid="login"]') and page.getByTestId('login') will locate the element. However, getByTestId() is the recommended approach because it is more readable and the attribute name can be configured globally via testIdAttribute in playwright.config.ts.page.getByLabel('Email') target?page.getByLabel('Email') finds form controls associated with a <label> element (via for attribute or nesting) as well as elements with a matching aria-label or aria-labelledby attribute. This makes it ideal for targeting form inputs accessibly.locator.filter({ hasText: 'Save' }) narrows a locator to only match elements whose text content includes "Save". You can also use { has: childLocator } to filter by the presence of a child element. This chaining pattern is fundamental to building robust, specific locators without relying on brittle CSS selectors.Assertions (Questions 5–7)
expect(locator).toHaveText('Hello World') asserts that the element's text content matches the expected string (whitespace is normalized). Use toContainText() when you only need a partial match. Both are auto-retrying assertions — they will keep checking until the timeout expires.expect() assertions different from standard Jest assertions?await them because they return promises.await expect(page).toHaveURL(/dashboard/) is recommended because it is an auto-retrying assertion. Option A uses a snapshot of the URL at that instant and will not retry if the page is still navigating. Option B accepts both strings and regular expressions and will wait for the URL to match.Auto-Waiting (Questions 8–10)
click() action, which checks does Playwright's auto-waiting mechanism perform?locator.waitFor({ state: 'attached' }) and page.waitForSelector('.item', { state: 'attached' }) will wait for the element to be in the DOM regardless of visibility. The default state for waitFor() is 'visible', so you must explicitly pass 'attached' if you want to wait for DOM presence only.fill() method targets a disabled input?fill() performs actionability checks including waiting for the element to be enabled. If the input becomes enabled before the timeout, Playwright fills it. If the timeout expires while the element is still disabled, Playwright throws a TimeoutError. This is part of the auto-waiting mechanism that eliminates manual waitForEnabled patterns.These 20 questions are just a preview. The full Playwright Automation Practice Tests course includes 190+ exam-style Q&A covering every topic tested in real interviews and certification exams.
- 190+ real exam-style questions with detailed explanations
- Covers commands, locators, auto-waiting, API testing, CI/CD
- MCP AI Agents section — the newest interview topic for 2026
- 5.0 rating from 131+ learners
Fixtures & Configuration (Questions 11–13)
test.extend() method?test.extend() lets you define custom fixtures that are automatically set up and torn down for each test. For example, you can create a todoPage fixture that initializes a Page Object Model class. Fixtures promote code reuse and ensure proper test isolation.playwright.config.ts, what does the use property inside a project configure?use property inside a project configures context options such as viewport, baseURL, headless, screenshot, trace, locale, and permissions. These options are applied to every test in that project. Test file selection uses testDir and testMatch, while workers and retries use their own top-level properties.npx playwright test --project=chromium runs tests only for the project named "chromium" as defined in your playwright.config.ts. You can specify multiple projects by repeating the flag: --project=chromium --project=firefox. There is no --browser flag in the Playwright test runner.API Testing (Questions 14–16)
playwright.request.newContext() creates a standalone API request context that operates without a browser. This is ideal for API-only tests, setting up test data, or verifying backend state. You can also use the request fixture in tests, which provides a pre-configured API context that shares cookies with the browser context.request.post(url, { data: { name: 'test' } }) automatically serializes the object to JSON and sets the Content-Type: application/json header. The data property accepts objects (auto-serialized to JSON), strings, or Buffers. There is no sendJSON method.page.request in a browser test, what is automatically shared with the browser context?page.request (or the context-bound context.request), cookies are automatically shared with the browser context. This means if you log in via the UI, subsequent API calls through page.request will include the authentication cookies. Local storage and session storage are not shared.Network Interception (Questions 17–18)
page.route(urlPattern, handler) intercepts requests matching the URL pattern and lets you fulfill, abort, or modify them. Inside the handler, you can call route.fulfill() to return a mock response, route.abort() to block the request, or route.continue() to let it proceed (optionally with modified headers). page.on('request') is for passive listening only.json shorthand (available in Playwright 1.29+), which automatically stringifies the object and sets the content type. Option B is the explicit approach using body with contentType. The json shorthand is more concise and is the recommended pattern in modern Playwright.Parallel Execution & CI/CD (Questions 19–20)
BrowserContext, which provides complete isolation: separate cookies, local storage, session storage, and cache. This is lighter than creating a new browser process for each test but still ensures zero state leakage. Multiple contexts can run in the same browser instance, which is why Playwright's parallel execution is fast.npx playwright install --with-deps installs both the Playwright browsers and their OS-level dependencies (like libgbm, libnss3, etc.). The --with-deps flag is critical in CI environments where system libraries may not be pre-installed. Without it, browser launch will fail with cryptic dependency errors.Score Yourself
Tally your correct answers and check where you stand:
- 18–20 correct: Expert level. You know Playwright inside and out — you are interview-ready.
- 14–17 correct: Strong foundation. Review the topics you missed and you will be fully prepared.
- 10–13 correct: Solid basics, but gaps remain. Focus on auto-waiting, fixtures, and API testing.
- Below 10: Time to study. Start with the Playwright Locators Guide and work through the fundamentals.
No matter your score, the best way to improve is to keep testing yourself. Active recall through practice questions builds the kind of instant-recall knowledge that interviewers and certification exams demand.
These 20 questions gave you a taste. The complete Playwright Automation Practice Tests 2026 course by Asim Noaman includes 190+ exam-style questions with detailed explanations — covering every topic that appears in real Playwright interviews and certification assessments.
- 190+ real exam-style questions with detailed explanations
- Covers commands, locators, auto-waiting, API testing, CI/CD
- MCP AI Agents section — the newest interview topic for 2026
- 5.0 rating from 131+ learners
- Lifetime access — new questions added regularly
Frequently Asked Questions
Are Playwright practice tests worth it for interview preparation?
Yes. Practice tests are one of the most effective ways to prepare for SDET and QA automation interviews. They force you to recall specific API methods, understand auto-waiting behavior, and think through edge cases — exactly what interviewers test. Studies show that active recall via practice questions improves retention 2–3x compared to passive reading.
How many questions are in the Playwright certification exam?
There is no single official Playwright certification exam from Microsoft. However, community-recognized practice test courses like the Playwright Automation Practice Tests 2026 course include 190+ questions covering all major topics: locators, assertions, auto-waiting, API testing, CI/CD, fixtures, and MCP AI Agents. Most employers value demonstrated skills over a certificate.
What is the best way to prepare for a Playwright interview?
The best preparation combines three activities: (1) hands-on practice writing real Playwright tests, (2) studying the official Playwright documentation for API details, and (3) testing yourself with MCQ-style practice questions to identify knowledge gaps. Focus on locators (getByRole, getByTestId), auto-waiting, fixtures, API testing, and CI/CD integration.
What Playwright topics are most commonly tested in quizzes?
The most frequently tested topics are: locator strategies (getByRole, getByLabel, getByTestId, locator), auto-waiting mechanism, assertions (toBeVisible, toHaveText, toHaveURL), fixtures and test isolation, Page Object Model pattern, API testing with request context, network interception, parallel execution, and CI/CD with GitHub Actions.
Can I use these practice questions for certification prep?
Absolutely. These 20 free questions cover the core topics that appear in Playwright certification-style assessments. For comprehensive preparation, the full Playwright Automation Practice Tests 2026 course offers 190+ questions with detailed explanations covering every major topic including the newest MCP AI Agents section.