Skip to content

Playwright Testing Interview Questions in Pune

36 practice questions with answers for Playwright Testing interviews in Pune.

Playwright Testing jobs in Pune

Pune combines IT-services campuses in Hinjewadi and Kharadi with product, automotive and BFSI technology centres. It has a large mid-level job market for data and QA roles, and interviews are often practical and project-based.

Below are 36 questions that match the mix of service, product and domain employers hiring Playwright automation engineers in Pune.

Solved for PuneStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

How do you handle authentication to avoid logging in every test?

Save to ▾
Show answer
Log in once in a setup project, save storageState to a file and reuse it in other projects or tests.
02

How do you use more than one reporter in the same run?

Save to ▾
Show answer
// playwright.config.ts export default defineConfig({ reporter: [ ['list'], ['html', { open: 'never', outputFolder: 'playwright-report' }], ['junit', { outputFile: 'results/junit.xml' }], ], });
03

What is the blob reporter and why does it exist?

Save to ▾
Show answer
The blob reporter writes a compact archive of everything about a run, including results, attachments and traces, into the blob-report folder. It is meant for machines rather than people. Each shard produces one blob, and npx playwright merge-reports later combines them into a single HTML, JUnit or JSON report. Without it, every shard would produce its own separate HTML report.
04

What is the difference between a type annotation and a type assertion with as?

Save to ▾
Show answer
A type annotation such as const user: User = data asks the compiler to check that the value really fits User. A type assertion such as data as User tells the compiler to trust you, so mismatches are not reported. In test code assertions are risky on API responses, because a wrong field passes compilation and fails later. Prefer annotations, type guards or runtime schema validation.
05

Tell me about a time you introduced component tests to a frontend team.

Save to ▾
Show answer
Situation: our end-to-end suite took 40 minutes and most failures were in form validation. Task: speed up feedback. Action: I set up Playwright component tests for the form library, wrote ten examples and a short guide, and paired with two developers on their first tests. Result: validation checks moved to component level, the end-to-end suite dropped to 25 minutes and developers began writing component tests themselves.
06

What does the reportSlowTests option do?

Save to ▾
Show answer
reportSlowTests makes Playwright list test files that took longer than a threshold at the end of the run. You set max, the number of files to show, and threshold in milliseconds, for example { max: 5, threshold: 60000 }. It is a cheap way to find files worth splitting, because one slow file can hold up a worker or a whole shard.
07

How does visual testing work in Playwright?

Save to ▾
Show answer
await expect(page).toHaveScreenshot('home.png') compares against a baseline image; tune maxDiffPixels and mask dynamic areas like dates.
08

Tell me about a time you learned a new testing tool under a deadline.

Save to ▾
Show answer
Situation: my team moved from another tool to Playwright two weeks before a release. Task: I had to migrate the smoke tests. Action: I spent two evenings on the official docs and codegen, rewrote one test end to end, then asked a senior to review it before converting the rest with the same pattern. Result: all 25 smoke tests ran in Playwright before the release and ran faster than before.
09

How do you handle dialogs such as alerts?

Save to ▾
Show answer
Register page.on('dialog', d => d.accept()) before the action triggers the dialog.
10

How do you capture browser console messages and page errors?

Save to ▾
Show answer
Listen with page.on('console', msg => ...) for console.log, warnings and errors, and page.on('pageerror', err => ...) for uncaught exceptions. Collect them in an array and attach them to the report on failure. Traces also show console output. Uncaught page errors often explain why a button did nothing or a page stayed blank.
11

How do you verify a page's URL and title after navigation?

Save to ▾
Show answer
await page.getByRole('link', { name: 'Orders' }).click(); await expect(page).toHaveURL(/\/orders$/); await expect(page).toHaveTitle('My Orders | Shop'); // both retry, so no need to wait for navigation manually
12

What are nth(), first() and last(), and why are they risky?

Save to ▾
Show answer
They pick one element by position from a locator that matches many. They are fine when order is truly meaningful, such as the first search result. They are risky when order depends on data, sorting or rendering speed, because the test may silently act on the wrong element. Prefer filtering by text or a child element that identifies the item.
13

How do you mock third-party APIs in UI tests?

Save to ▾
Show answer
Use page.route to intercept the call and fulfil it with fixed JSON so tests do not depend on external systems.
14

Why can beforeAll run more than once in a Playwright run?

Save to ▾
Show answer
Each worker is a separate process with its own state. When tests from a file are split across workers, or a worker restarts after a failure, beforeAll runs again in the new worker. So never assume it runs only once globally. For one-time setup across the whole run, use a setup project with dependencies or globalSetup.
15

How do access modifiers help in page object classes?

Save to ▾
Show answer
private and protected hide internal locators and helper steps, so tests can only call meaningful public methods such as login or addToCart. This keeps tests readable and lets you change internals without breaking callers. readonly on the page field prevents it from being replaced. TypeScript enforces these at compile time only, not at runtime.
16

How do you assert an element's CSS class, attribute or value?

Save to ▾
Show answer
const btn = page.getByRole('button', { name: 'Submit' }); await expect(btn).toHaveClass(/disabled/); await expect(btn).toHaveAttribute('aria-busy', 'true'); await expect(page.getByLabel('City')).toHaveValue('Pune'); await expect(btn).toHaveCSS('cursor', 'not-allowed');
17

What is UI mode and how is it different from --debug?

Save to ▾
Show answer
UI mode, opened with npx playwright test --ui, is a dashboard to run, filter and watch tests, with a trace-like timeline for each one and a watch mode that reruns on file changes. --debug opens the Inspector to step through a single run live. Use UI mode for daily development and --debug for stepping through a specific action.
18

Tell me how you learned TypeScript quickly for a project.

Save to ▾
Show answer
Situation: I joined a team whose Playwright suite was in TypeScript while I knew only basic JavaScript. Task: become productive in two weeks. Action: I studied types, interfaces and generics in the evenings, read the team's page objects, and fixed small compiler errors as practice. Result: by week three I was writing new tests and reviewing simple pull requests.
19

How do you test a dropdown component's keyboard support in a component test?

Save to ▾
Show answer
Mount the dropdown, focus the trigger and press Enter or ArrowDown to open it. Assert the listbox is visible and the first option has aria-selected or focus. Press ArrowDown again and check the active option moves, then press Enter and assert the trigger shows the chosen value and the list is closed. Finally press Escape on an open list to confirm it closes without changing the value.
20

What are projects in playwright.config?

Save to ▾
Show answer
Named configurations that run the same tests across different browsers, devices or environments.
21

How do you run Playwright in GitHub Actions?

Save to ▾
Show answer
Workflow: checkout → setup-node → npm ci → npx playwright install --with-deps → npx playwright test → upload playwright-report as an artifact.
22

How do you perform drag and drop and hover?

Save to ▾
Show answer
locator.hover() and locator.dragTo(target) perform these actions, with auto-waiting for actionability.
23

What is destructuring and the spread operator?

Save to ▾
Show answer
Destructuring pulls values from arrays or objects into variables; spread expands an array or object into another, useful for copying and merging config.
24

How do you fail a test if the page logs any console error?

Save to ▾
Show answer
test('no console errors', async ({ page }) => { const errors: string[] = []; page.on('console', m => { if (m.type() === 'error') errors.push(m.text()); }); page.on('pageerror', e => errors.push(e.message)); await page.goto('/dashboard'); expect(errors).toEqual([]); });
25

Why did you choose to build a career in Playwright automation?

Save to ▾
Show answer
I like that automation combines coding with product quality. I learned Selenium first, then moved to Playwright because auto-waiting, tracing and API support let me write stable tests faster. In my college project I automated twenty flows with TypeScript and a CI pipeline. I want a role where I can grow into framework design and CI ownership.
26

How do you check a checkbox and verify it is checked?

Save to ▾
Show answer
const terms = page.getByRole('checkbox', { name: 'I agree to the terms' }); await terms.check(); await expect(terms).toBeChecked(); await terms.uncheck(); await expect(terms).not.toBeChecked(); // setChecked(true) works for both cases
27

What is the difference between a type and an enum in TypeScript?

Save to ▾
Show answer
A type alias describes a shape or union of values; an enum creates a named set of constants that exists at runtime.
28

Promise.all vs Promise.allSettled vs Promise.race?

Save to ▾
Show answer
all waits for every promise and rejects on the first failure; allSettled waits for all and reports each outcome; race settles with the first one to finish.
29

How do you manage flaky tests without hiding real failures?

Save to ▾
Show answer
Use retries in CI so one-off failures do not block merges, but treat any test marked flaky in the report as a defect. Track flaky tests on a dashboard, quarantine repeat offenders with a tag and an owner, and set a deadline to fix or delete them. Never retry without investigating, or real intermittent bugs will be missed.
30

How do you test a file download?

Save to ▾
Show answer
const [download] = await Promise.all([ page.waitForEvent('download'), page.getByText('Export').click(), ]); await download.saveAs('reports/file.csv');
31

What is the difference between unknown and any in TypeScript?

Save to ▾
Show answer
any switches off type checking, so any property access compiles even if it crashes at runtime. unknown accepts any value but forces you to narrow or validate it before use. For API JSON in tests, typing it as unknown and then validating or asserting a type is safer than any, because mistakes appear at compile time.
32

Test data is left behind when tests fail midway. How do you guarantee cleanup?

Save to ▾
Show answer
Create the data inside a fixture and delete it after await use(). Fixture teardown runs even when the test fails or times out, so cleanup is reliable. Avoid cleanup steps at the end of the test body, because they never run after a failed assertion. As a safety net, tag test data with a prefix and run a nightly cleanup job.
33

A locator matches three Delete buttons and the test fails with a strict mode violation. How do you fix it?

Save to ▾
Show answer
First scope the locator to the item you mean, for example the row that contains the user's name: page.getByRole('row', { name: 'Ravi Kumar' }).getByRole('button', { name: 'Delete' }). Do not reach for first() or nth() as a quick fix, because the order can change and the test may delete the wrong record. Scoping by meaningful context is stable and readable.
34

What happens the first time toHaveScreenshot runs and no baseline image exists?

Save to ▾
Show answer
Playwright cannot compare anything, so it captures the screenshot, saves it as the new baseline in the snapshots folder and marks the test as failed with a message that the snapshot was missing. On the next run the test compares against that file. This is why you review new baselines before committing them, and why baselines should be generated in the same environment that CI uses.
35

How do you handle GraphQL APIs in Playwright?

Save to ▾
Show answer
POST the query and variables as JSON to the single endpoint and assert both data and errors fields in the response.
36

How do you test pagination or chained API calls?

Save to ▾
Show answer
Read the next page link or IDs from earlier responses, loop until done and assert counts and uniqueness; pass IDs between calls in the same test.

Companies with offices in Pune (57)

IT services

TCS

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Mumbai, Chennai, Pune +2

View questions
IT services

Infosys

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Mysuru, Pune +2

View questions
IT services

Wipro

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad, Pune +2

View questions
Consulting

Accenture

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad, Pune +2

View questions
IT services

Cognizant

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Chennai, Bengaluru, Pune +2

View questions
IT services

Capgemini

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Mumbai, Bengaluru, Pune +2

View questions
Consulting

Deloitte

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Hyderabad, Bengaluru, Mumbai +2

View questions
Product

Amazon

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Chennai +2

View questions
Product

Google

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Gurugram +2

View questions
Product

Microsoft

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Noida +2

View questions
Product

Oracle

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Noida +2

View questions
Hardware & semiconductors

Cisco

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Pune, Chennai

View questions
Fintech

PhonePe

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Pune

View questions
Fintech

Mastercard

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Pune, Vadodara, Gurugram +1

View questions
Banking & finance

Barclays

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Chennai, Noida +1

View questions
Banking & finance

HSBC

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Hyderabad, Pune, Bengaluru

View questions
IT services

Tech Mahindra

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Hyderabad, Bengaluru +2

View questions
IT services

IBM

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Pune, Hyderabad +2

View questions
Consulting

KPMG

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Bengaluru, Mumbai +2

View questions
IT services

Mphasis

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Pune, Chennai

View questions
IT services

LTIMindtree

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Mumbai, Pune, Bengaluru +2

View questions
IT services

Persistent Systems

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Nagpur, Bengaluru +2

View questions
IT services

Hexaware

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Navi Mumbai, Chennai, Pune +2

View questions
IT services

Coforge

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Greater Noida, Bengaluru +2

View questions

Frequently asked questions

Which companies hire Playwright Testing professionals in Pune?

Companies with large offices in Pune include TCS, Infosys, Wipro, Accenture, Cognizant, Capgemini, Deloitte, Amazon, Google, Microsoft. Use their company pages below to practise employer-specific sets.

Are Playwright Testing interviews in Pune different from other cities?

The questions depend more on the company than the city. Pune's mix of employers decides the style: It has a large mid-level job market for data and QA roles, and interviews are often practical and project-based

How do I find Playwright Testing jobs in Pune?

Shortlist companies with Pune offices, keep your CV focused on Playwright Testing projects, apply on company career pages and job portals with the Pune filter, and practise the questions on this page before each interview.