LearnThatStack Ace your next interview
Frontend Development
Playwright.
49 Qs 7 free
Change topic Change
Drill · questions

All questions

of 49
Beginner 6
01

How does Playwright differ from Selenium?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Playwright advantages over Selenium:

  • No WebDriver dependency: Direct browser automation through browser APIs
  • Auto-wait: Built-in intelligent waiting mechanisms
  • Better performance: Faster execution and more reliable
  • Modern browser features: Better support for modern web technologies
  • Network interception: Built-in network mocking and monitoring
  • Multiple contexts: Can run multiple isolated browser contexts

Selenium advantages:

  • Mature ecosystem: Longer history with extensive community support
  • More language bindings: Supports more programming languages
  • Grid infrastructure: More mature distributed testing solutions
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

02

What are the different browsers supported by Playwright?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Playwright supports three main browser engines:

  1. Chromium - Works with Chrome, Edge, and other Chromium-based browsers
  2. Firefox - Mozilla Firefox browser
  3. WebKit - Safari browser engine
// Example of running tests on different browsers
const { chromium, firefox, webkit } = require('playwright');

// Launch different browsers
const chromeContext = await chromium.launch();
const firefoxContext = await firefox.launch();
const safariContext = await webkit.launch();
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

03

How do you install and set up Playwright in a new project?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Installation steps:

# Install Playwright
npm init playwright@latest

# Or add to existing project
npm install @playwright/test

# Install browsers
npx playwright install

Basic configuration in playwright.config.js:

module.exports = {
  testDir: './tests',
  timeout: 30000,
  use: {
    browserName: 'chromium',
    headless: true,
    screenshot: 'only-on-failure'
  },
  projects: [
    { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
    { name: 'firefox', use: { ...devices['Desktop Firefox'] } }
  ]
};
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

04

What are locators in Playwright and how do they differ from selectors?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Locators are Playwright's way of finding elements on a page. They represent a query for elements and are auto-waiting and retry-able.

Selectors are the actual query strings used to find elements.

// Locator (recommended approach)
const button = page.locator('button[data-testid="submit"]');
await button.click();

// Direct selector (not recommended for interactions)
const element = await page.$('button[data-testid="submit"]');

Benefits of locators:

  • Auto-wait for element to be actionable
  • Built-in retry logic
  • Better error messages
  • Lazy evaluation
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

05

How do you perform common actions like click, type, and select in Playwright?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
// Click actions
await page.locator('#submit-btn').click();
await page.locator('#menu').click({ button: 'right' }); // Right click
await page.locator('#item').dblclick(); // Double click

// Text input
await page.locator('#username').fill('john.doe@example.com');
await page.locator('#search').type('playwright testing', { delay: 100 });

// Dropdown selection
await page.locator('#country').selectOption('USA');
await page.locator('#colors').selectOption(['red', 'blue']); // Multiple

// Checkbox and radio buttons
await page.locator('#agree-terms').check();
await page.locator('#newsletter').uncheck();

// File upload
await page.locator('#file-input').setInputFiles('./document.pdf');

// Keyboard actions
await page.keyboard.press('Enter');
await page.keyboard.type('Hello World');
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

06

What are the common expectation methods available in Playwright?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
// Element state expectations
await expect(locator).toBeVisible();
await expect(locator).toBeHidden();
await expect(locator).toBeEnabled();
await expect(locator).toBeDisabled();
await expect(locator).toBeFocused();
await expect(locator).toBeChecked();

// Text content expectations
await expect(locator).toHaveText('Expected text');
await expect(locator).toContainText('partial text');
await expect(locator).toHaveValue('input value');

// Attribute expectations
await expect(locator).toHaveAttribute('class', 'active');
await expect(locator).toHaveClass(['btn', 'primary']);

// Page expectations
await expect(page).toHaveURL('/expected-url');
await expect(page).toHaveTitle('Page Title');

// Count expectations
await expect(page.locator('.item')).toHaveCount(5);
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

Intermediate 22
07

Explain the Playwright configuration file and its key options

Intermediate ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The playwright.config.js file controls test execution behavior and browser settings.

Key configuration options:

module.exports = {
  // Test directory
  testDir: './tests',
  
  // Global timeout for each test
  timeout: 30000,
  
  // Global setup and teardown
  globalSetup: './global-setup.js',
  globalTeardown: './global-teardown.js',
  
  // Retry failed tests
  retries: 2,
  
  // Parallel execution
  workers: process.env.CI ? 1 : undefined,
  
  // Reporter configuration
  reporter: [['html'], ['junit', { outputFile: 'results.xml' }]],
  
  // Browser and context settings
  use: {
    baseURL: 'http://localhost:3000',
    headless: true,
    screenshot: 'only-on-failure',
    video: 'retain-on-failure',
    trace: 'on-first-retry'
  },
  
  // Multiple browser projects
  projects: [
    { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
    { name: 'mobile', use: { ...devices['iPhone 12'] } }
  ]
};
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

08

What are the different types of locators available in Playwright?

Part of Pro
09

How do you handle dynamic elements or elements that appear after some time?

Part of Pro
10

How do you handle iframes in Playwright?

Part of Pro
11

What is the difference between assertions and expectations in Playwright?

Part of Pro
12

What is a Browser Context in Playwright and why is it important?

Part of Pro
13

How do you handle multiple pages or tabs in Playwright?

Part of Pro
14

What is the Page Object Model and how do you implement it in Playwright?

Part of Pro
15

Can you perform API testing with Playwright? How?

Part of Pro
16

How do you handle authentication and maintain session state in Playwright?

Part of Pro
17

How do you handle file downloads and uploads in Playwright?

Part of Pro
18

What are the debugging tools and techniques available in Playwright?

Part of Pro
19

What are the best practices for writing maintainable Playwright tests?

Part of Pro
20

How do you test internationalization (i18n) with Playwright?

Part of Pro
21

How do you test complex forms with validation using Playwright?

Part of Pro
22

How do you test clipboard functionality with Playwright?

Part of Pro
23

How do you test geolocation features with Playwright?

Part of Pro
24

How do you test responsive design and device emulation comprehensively?

Part of Pro
25

How do you test browser storage (localStorage, sessionStorage, IndexedDB)?

Part of Pro
26

How do you test notifications and permissions with Playwright?

Part of Pro
27

How do you test CSS animations and transitions?

Part of Pro
28

How do you test drag and drop with HTML5 Drag API?

Part of Pro
Expert 21
29

How do you implement network interception and mocking in Playwright?

Part of Pro
30

How do you handle flaky tests in Playwright?

Part of Pro
31

How do you organize and structure large Playwright test suites?

Part of Pro
32

How do you implement data-driven testing in Playwright?

Part of Pro
33

How do you run Playwright tests in parallel and what are the considerations?

Part of Pro
34

How do you handle complex page object hierarchies and inheritance?

Part of Pro
35

How do you combine UI and API testing in the same test?

Part of Pro
36

How do you implement visual regression testing with Playwright?

Part of Pro
37

How do you test PWA (Progressive Web App) features with Playwright?

Part of Pro
38

How do you test different network conditions with Playwright?

Part of Pro
39

How do you implement custom Playwright fixtures?

Part of Pro
40

How do you test WebRTC functionality with Playwright?

Part of Pro
41

How do you test Service Workers with Playwright?

Part of Pro
42

How do you test performance metrics and Core Web Vitals?

Part of Pro
43

How do you test WebGL and Canvas functionality?

Part of Pro
44

How do you test Web Workers and background processing?

Part of Pro
45

How do you test Web Audio API functionality?

Part of Pro
46

How do you test WebRTC peer-to-peer connections?

Part of Pro
47

How do you test complex user workflows across multiple pages?

Part of Pro
48

How do you test accessibility (a11y) comprehensively with Playwright?

Part of Pro
49

How do you implement end-to-end testing for a complete application with Playwright?

Part of Pro

No matches

Try a different filter or search term.

Pro · $10/mo

42 of 49 Playwright answers are gated.

Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.

  • Full answers + code
  • AI explain - simpler, deeper, or visualized
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

JAM

JavaScript, APIs, and Markup

Serverless on AWS

Serverless Architecture on AWS

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Flutter Mobile

Flutter Cross-Platform Mobile Development

Cross-cutting topics 44 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

Web3 / Ethereum

Solidity, Ethereum, Hardhat, Foundry

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git
Big-O & Complexity Analysis Arrays, Strings & Hash Tables Linked Lists, Stacks & Queues Trees, BSTs & Heaps Graphs Sorting, Searching & Recursion Operating Systems Concurrency & Multithreading Networking for Developers Git & Version Control API Design 45 Distributed Systems Fundamentals 34

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.


Cross-cutting topics 45 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.