Playwright interview questions — Easy

401 easy-level Playwright questions from our Automation Testing bank, each with the correct answer and an explanation of why it is correct.

What this covers

Playwright appears throughout Automation Testing interviews. At easy level, interviewers are typically checking that you know the fundamentals and can describe them precisely — definitions, defaults, and the basic mechanics. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. Which of the following best describes test.use() in Playwright?

    • A. Waits for a network response matching a URL or predicate.
    • B. Opens the HTML report of the last test run.
    • C. Retrying assertion that the element is visible.
    • D. Overrides fixtures/options such as viewport or locale for a test group.correct

    Why: test.use(): Overrides fixtures/options such as viewport or locale for a test group.

  2. 2. Which of the following best describes projects in Playwright?

    • A. Config option that records a trace only when a test is retried.
    • B. Waits for a network response matching a URL or predicate.
    • C. Overrides fixtures/options such as viewport or locale for a test group.
    • D. Config entries that run the suite against multiple browsers or devices.correct

    Why: projects: Config entries that run the suite against multiple browsers or devices.

  3. 3. Which of the following best describes expect(locator).toBeVisible() in Playwright?

    • A. Creates a fresh isolated browser session.
    • B. Retrying assertion that the element is visible.correct
    • C. Config option that records a trace only when a test is retried.
    • D. Config entries that run the suite against multiple browsers or devices.

    Why: expect(locator).toBeVisible(): Retrying assertion that the element is visible.

  4. 4. Which of the following best describes fullyParallel in Playwright?

    • A. Captures a screenshot of the page or viewport.
    • B. Groups actions into a named step shown in reports and traces.
    • C. Config flag that runs tests within a single file in parallel.correct
    • D. Clears and types text into an input field.

    Why: fullyParallel: Config flag that runs tests within a single file in parallel.

  5. 5. Which of the following best describes page.screenshot() in Playwright?

    • A. Groups actions into a named step shown in reports and traces.
    • B. Performs an actionability-checked click on the matched element.
    • C. Clears and types text into an input field.
    • D. Captures a screenshot of the page or viewport.correct

    Why: page.screenshot(): Captures a screenshot of the page or viewport.

  6. 6. In the context of Playwright, test.step() is best described as:

    • A. Groups actions into a named step shown in reports and traces.correct
    • B. Creates a fresh isolated browser session.
    • C. Waits for a network response matching a URL or predicate.
    • D. Config option that records a trace only when a test is retried.

    Why: test.step(): Groups actions into a named step shown in reports and traces.

  7. 7. Which of the following best describes browser.newContext() in Playwright?

    • A. Creates a fresh isolated browser session.correct
    • B. Locates elements by the data-testid attribute.
    • C. Opens the HTML report of the last test run.
    • D. Retrying assertion that the element is visible.

    Why: browser.newContext(): Creates a fresh isolated browser session.

  8. 8. Which of the following best describes test.step() in Playwright?

    • A. Captures a screenshot of the page or viewport.
    • B. Groups actions into a named step shown in reports and traces.correct
    • C. Config flag that runs tests within a single file in parallel.
    • D. Overrides fixtures/options such as viewport or locale for a test group.

    Why: test.step(): Groups actions into a named step shown in reports and traces.

  9. 9. Which of the following best describes page.waitForResponse() in Playwright?

    • A. Waits for a network response matching a URL or predicate.correct
    • B. Retrying assertion that the element is visible.
    • C. Overrides fixtures/options such as viewport or locale for a test group.
    • D. Locates elements by the data-testid attribute.

    Why: page.waitForResponse(): Waits for a network response matching a URL or predicate.

  10. 10. Which of the following best describes page.goto() in Playwright?

    • A. Executes JavaScript in the page's context and returns the result.
    • B. Config flag that runs tests within a single file in parallel.
    • C. Clears and types text into an input field.
    • D. Navigates the page to a URL and waits for the load state.correct

    Why: page.goto(): Navigates the page to a URL and waits for the load state.

  11. 11. While onboarding a junior QA, you explain: Which Playwright tool replays a run with DOM snapshots and network for debugging?

    • A. Selenium IDE.
    • B. Trace Viewer.correct
    • C. JMeter Listener.
    • D. Appium Inspector.

    Why: Trace Viewer replays runs with snapshots, network, and console.

  12. 12. Which of the following best describes locator.click() in Playwright?

    • A. Waits for a network response matching a URL or predicate.
    • B. Performs an actionability-checked click on the matched element.correct
    • C. Config flag that runs tests within a single file in parallel.
    • D. Creates a fresh isolated browser session.

    Why: locator.click(): Performs an actionability-checked click on the matched element.

  13. 13. In Playwright, what does expect(locator).toBeVisible() do or refer to?

    • A. Retrying assertion that the element is visible.correct
    • B. Waits for a network response matching a URL or predicate.
    • C. Executes JavaScript in the page's context and returns the result.
    • D. Locates elements by the data-testid attribute.

    Why: expect(locator).toBeVisible(): Retrying assertion that the element is visible.

  14. 14. In Playwright, what does page.waitForResponse() do or refer to?

    • A. Waits for a network response matching a URL or predicate.correct
    • B. Locates elements by the data-testid attribute.
    • C. Creates a fresh isolated browser session.
    • D. Config option that records a trace only when a test is retried.

    Why: page.waitForResponse(): Waits for a network response matching a URL or predicate.

  15. 15. In Playwright, what does trace: 'on-first-retry' do or refer to?

    • A. Config entries that run the suite against multiple browsers or devices.
    • B. Config option that records a trace only when a test is retried.correct
    • C. Groups actions into a named step shown in reports and traces.
    • D. Locates elements by the data-testid attribute.

    Why: trace: 'on-first-retry': Config option that records a trace only when a test is retried.

  16. 16. What is the purpose of trace: 'on-first-retry' in Playwright?

    • A. Opens the HTML report of the last test run.
    • B. Config entries that run the suite against multiple browsers or devices.
    • C. Config option that records a trace only when a test is retried.correct
    • D. Config flag that runs tests within a single file in parallel.

    Why: trace: 'on-first-retry': Config option that records a trace only when a test is retried.

  17. 17. Which of the following best describes getByTestId() in Playwright?

    • A. Retrying assertion that the element is visible.
    • B. Overrides fixtures/options such as viewport or locale for a test group.
    • C. Locates elements by the data-testid attribute.correct
    • D. Groups actions into a named step shown in reports and traces.

    Why: getByTestId(): Locates elements by the data-testid attribute.

  18. 18. In Playwright, what does npx playwright show-report do or refer to?

    • A. Locates elements by the data-testid attribute.
    • B. Opens the HTML report of the last test run.correct
    • C. Groups actions into a named step shown in reports and traces.
    • D. Navigates the page to a URL and waits for the load state.

    Why: npx playwright show-report: Opens the HTML report of the last test run.

  19. 19. Which of the following best describes trace: 'on-first-retry' in Playwright?

    • A. Executes JavaScript in the page's context and returns the result.
    • B. Config option that records a trace only when a test is retried.correct
    • C. Overrides fixtures/options such as viewport or locale for a test group.
    • D. Captures a screenshot of the page or viewport.

    Why: trace: 'on-first-retry': Config option that records a trace only when a test is retried.

  20. 20. In Playwright, what does projects do or refer to?

    • A. Config entries that run the suite against multiple browsers or devices.correct
    • B. Executes JavaScript in the page's context and returns the result.
    • C. Opens the HTML report of the last test run.
    • D. Clears and types text into an input field.

    Why: projects: Config entries that run the suite against multiple browsers or devices.

Related Automation Testing topics