Playwright Authentication and Network Mocking MCQ Mock Test (200 Questions)

← All Playwright mock interview topics

Test your knowledge of Authentication and Network Control with a timed Playwright MCQ mock test. Each attempt gives you 20 random questions in 20 minutes from a 200-question bank covering storage state and setup projects, multiple roles, cookies and init scripts, page.route mocking with fulfill, abort, continue and fetch, HAR recording and replay, network events, the Clock API, and passkey testing with WebAuthn virtual authenticators. Submit to see your score, the correct answers and an explanation for every question.

Advertisement

What this mock test covers

The questions follow Module 8 of the free Playwright with TypeScript tutorial. Revise these lessons if a question catches you out:

Advertisement

Sample questions with answers

  • Q. What does a Playwright 'storage state' file contain?
    Answer: Cookies and localStorage for each origin (optionally IndexedDB), saved as JSON
    Loading it into a new context restores an authenticated session without logging in again.
  • Q. How do you save the current authentication state to a file?
    Answer: await page.context().storageState({ path: 'playwright/.auth/user.json' })
    `storageState({ path })` writes cookies and localStorage to disk.
  • Q. How do you make tests start already logged in?
    Answer: use: { storageState: 'playwright/.auth/user.json' } in the config or project
    Every new context in those tests loads the saved state.
  • Q. What is the recommended way to log in once before all tests?
    Answer: A setup project (e.g. auth.setup.ts) that logs in and saves storage state, with other projects depending on it
    Setup projects appear in reports and traces and can be reused by many projects.
  • Q. Why add `playwright/.auth` to .gitignore?
    Answer: It contains session cookies and tokens, which are sensitive and short-lived
    Storage state files are effectively credentials.

Ready for more? Go back to the Playwright mock interview dashboard to track your overall interview readiness across all topics.

Advertisement

Frequently asked questions

How many questions does the Authentication and Network Control mock test have?

The question bank has 200 questions. Each test picks 20 at random, favouring questions you have not seen, so about 10 attempts cover the full bank.

What is the pass mark?

You pass a test with 70% or more, which is 14 of 20 questions correct.

Can I retake the test?

Yes. Retake as often as you like. Every retake draws a fresh set of 20 questions and counts toward your 20-exam readiness target.