← All Playwright Python mock interview topics
Test your knowledge of API Testing with Playwright Python with a timed Playwright Python MCQ mock test. Each attempt gives you 20 random questions in 20 minutes from a 200-question bank covering APIRequestContext and playwright.request, GET, POST, PUT, PATCH, DELETE and HEAD, JSON, form and multipart bodies, query params, headers and auth, APIResponse status, ok, json and headers, expect(response).to_be_ok, fail_on_status_code, redirects, fixtures and cleanup, schema checks, API clients in a framework, and combining API setup with UI tests. Submit to see your score, the correct answers and an explanation for every question.
What this mock test covers
The questions follow Module 9 of the free Playwright with Python & Pytest tutorial. The Python lessons for this module are on the way; until then, revise with these related tutorials:
- API testing: GET, POST, PUT, DELETE
- API automation with a client layer
- Read and write JSON in Python
Sample questions with answers
- Q. Which Playwright class sends HTTP requests without opening a browser page?
Answer: APIRequestContext
Create one with playwright.request.new_context(). - Q. Which call creates a standalone API client in a sync script?
Answer: playwright.request.new_context(base_url='https://api.test')
No browser is needed. - Q. Which APIRequestContext methods exist in Playwright 1.64?
Answer: get, post, put, patch, delete, head and fetch
Verified by introspection. - Q. Which method sends a request with any HTTP method you choose?
Answer: api.fetch(url, method='OPTIONS')
fetch takes a method argument. - Q. What does api.get('/users/1') resolve against?
Answer: The base_url given to new_context
Relative paths need a base_url.
Ready for more? Go back to the Playwright Python mock interview dashboard to track your overall interview readiness.
Frequently asked questions
How many questions does the API Testing with Playwright Python 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.