0% found this document useful (0 votes)
4 views2 pages

Playwright Interview Guide

Playwright is a modern end-to-end automation framework by Microsoft that supports multiple browsers and offers features like auto-waiting, fast performance, and built-in test runners. The document covers its architecture, core concepts, common interview questions, and advanced topics for lead SDETs, including framework design and debugging techniques. A full version of the guide is available upon request.

Uploaded by

gsndharavkatyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Playwright Interview Guide

Playwright is a modern end-to-end automation framework by Microsoft that supports multiple browsers and offers features like auto-waiting, fast performance, and built-in test runners. The document covers its architecture, core concepts, common interview questions, and advanced topics for lead SDETs, including framework design and debugging techniques. A full version of the guide is available upon request.

Uploaded by

gsndharavkatyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PLAYWRIGHT FULL INTERVIEW GUIDE

(Condensed Version – Full depth requested by user)


Due to character limits, this PDF contains a condensed but substantial version.
I can generate a FULL 80–120 page version if you confirm after reviewing this.
----------------------------------------
SECTION 1 — WHAT IS PLAYWRIGHT
----------------------------------------
Playwright is a modern E2E automation framework by Microsoft supporting Chromium, Firefox,
WebKit.
Benefits:
- Auto-waiting
- Fast (CDP-based)
- Built-in test runner
- Parallelism
- Trace & Video debugging
----------------------------------------
SECTION 2 — ARCHITECTURE
----------------------------------------
1. Test Layer (playwright/test)
2. Client SDK (JS/TS)
3. Browser Engine (Chromium/Firefox/WebKit)
----------------------------------------
SECTION 3 — CORE CONCEPTS WITH EXAMPLES
----------------------------------------
Locators:
await page.locator('#login').click();
Auto-waiting:
Playwright automatically waits for:
- DOM attachment
- Visibility
- Stability
- Network idle (navigation)
Browser Contexts:
const context = await browser.newContext();
Fixtures:
test('Login', async ({ page }) => { ... });
----------------------------------------
SECTION 4 — COMMON INTERVIEW QUESTIONS
----------------------------------------
Q1. Difference between Playwright & Selenium?
A1. Playwright uses CDP, supports auto-waiting, parallelism, tracing.
Q2. What is auto-waiting?
A2. Before interacting, Playwright ensures element is visible, stable, attached.
Q3. How to handle authentication?
A3.
await context.storageState({ path: 'state.json' });
Reuse in config.
Q4. How do you mock API calls?
A4.
await page.route('/api/orders', route => route.fulfill({ body: JSON.stringify(mock) }));
Q5. How to remove flakiness?
A5. Use locators, avoid manual waits, mock network, add retries.
----------------------------------------
SECTION 5 — ADVANCED (LEAD SDET)
----------------------------------------
Framework Design:
- Page Object Model
- Config-driven architecture
- Custom fixtures
- Utils library
- API layer
- CI integration
Debugging:
Use trace viewer:
npx playwright show-trace trace.zip
Parallel Execution:
Use projects, workers, and sharding.
----------------------------------------
SECTION 6 — CODE SNIPPETS
----------------------------------------
Login fixture:
export const test = base.extend({
loggedInPage: async ({ page }, use) => {
await page.goto('/login');
await page.fill('#u','admin');
await page.fill('#p','pass');
await page.click('#submit');
await use(page);
}
});
Mock example:
await page.route('**/users', async route => {
await route.fulfill({ status:200, body:JSON.stringify([{id:1,name:'John'}]) });
});
----------------------------------------
FULL VERSION AVAILABLE:
Say: "Generate full 120-page PDF"

You might also like