Skip to content

Playwright Testing Interview Questions in Noida

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

Playwright Testing jobs in Noida

Noida is a major IT and IT-services hub in Delhi NCR with large campuses of service companies, product firms and fast-growing start-ups along the Noida–Greater Noida Expressway. Freshers often find their first role here, and many teams run hybrid work.

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

Solved for NoidaStart 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

Explain the event loop.

Save to ▾
Show answer
JavaScript runs one call stack and uses queues for async work; the event loop pushes callbacks from the microtask (promises) and task queues when the stack is empty.
02

How do you validate an API response in Playwright?

Save to ▾
Show answer
Assert the status with expect(res.status()).toBe(200), parse res.json() and check fields, using schema validation for the structure.
03

How do you handle file uploads and downloads?

Save to ▾
Show answer
setInputFiles on the input for uploads; for downloads wait on page.waitForEvent('download') and save or inspect the file.
04

What does outputDir contain and why does it matter in parallel runs?

Save to ▾
Show answer
outputDir, test-results by default, holds per-test artifacts such as screenshots, videos and traces. Playwright creates a separate subfolder for each test and retry, so parallel workers do not overwrite each other's files. testInfo.outputPath gives you a safe path inside it for your own files. It is cleared at the start of every run, so do not store anything permanent there.
05

How do you create test data through the API before a UI test?

Save to ▾
Show answer
In a fixture or beforeEach, call the API (request.post) to create the user or order, use it in the UI test, then delete it in teardown. It is faster and more reliable than creating data through the UI.
06

Write a typed helper that retries an async function a few times.

Save to ▾
Show answer
async function retry<T>(fn: () => Promise<T>, times = 3): Promise<T> { let lastError: unknown; for (let i = 0; i < times; i++) { try { return await fn(); } catch (e) { lastError = e; } } throw lastError; }
07

Tell me about setting up CI for a test suite.

Save to ▾
Show answer
Situation: our team ran tests only on laptops before releases. Task: run them automatically on every pull request. Action: I created a CI workflow with browser install, sharding over four machines, merged HTML reports and traces on retry. Result: feedback came within twelve minutes on each pull request, and release-day surprises dropped sharply.
08

How do you add or change request headers for only some requests?

Save to ▾
Show answer
Register a route for the matching URLs and call route.continue({ headers: { ...route.request().headers(), 'x-test-mode': 'true' } }). Other requests are untouched. For headers on every request, use extraHTTPHeaders in the config instead. This is useful for feature toggles, tenant ids or bypass tokens that only certain endpoints accept.
09

Write a custom fixture that gives a logged-in page.

Save to ▾
Show answer
import { test as base } from '@playwright/test'; export const test = base.extend({ loggedInPage: async ({ page }, use) => { await page.goto('/login'); await page.getByLabel('Email').fill('qa@test.in'); await page.getByLabel('Password').fill('Pass@123'); await page.getByRole('button', { name: 'Sign in' }).click(); await use(page); }, });
10

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
11

What actionability checks does Playwright run before a click?

Save to ▾
Show answer
Before clicking, Playwright waits until the element is attached, visible, stable (not animating), enabled and able to receive events (not covered by another element). It also scrolls it into view. fill checks for an editable element. If the checks are not met before the timeout, the action fails with a log of what was missing.
12

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.
13

What are generics in TypeScript?

Save to ▾
Show answer
Placeholders for types that make reusable code type-safe, for example a helper function returning the same type of item that it receives.
14

What is the HTML report and how do you open it?

Save to ▾
Show answer
The HTML reporter creates a playwright-report folder with every test, its steps, errors, attachments, screenshots and trace links. Open it with npx playwright show-report. You can filter by status, project and tags. In CI, upload the folder as an artifact so anyone can download and open it, and the report opens automatically locally when tests fail.
15

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.
16

What are automatic fixtures?

Save to ▾
Show answer
A fixture defined with { auto: true } runs for every test even when the test does not ask for it. It is useful for cross-cutting work such as attaching console logs on failure, setting a feature flag or checking for leftover data. Keep auto fixtures light, because they add cost to every test in the suite.
17

How do you pass slots and listen to events in a Vue component test?

Save to ▾
Show answer
With the Vue package you can mount with an options object: mount(Button, { props: { label: 'Save' }, slots: { default: 'Click me' }, on: { click: handler } }). The on map receives emitted events, so you can push payloads into an array and assert on them. JSX syntax is also supported if the project is configured for it.
18

How do you test that the app retries a request that failed the first time?

Save to ▾
Show answer
Register a route with a counter: on the first call use route.fulfill with status 503, and on later calls fulfil with a success body. Perform the action, then assert the UI shows the final data and the counter equals 2. You can also check that no error message flashed. This proves the retry logic works without waiting for a real outage.
19

How do you assert that a request was sent with the correct payload?

Save to ▾
Show answer
const reqPromise = page.waitForRequest(r => r.url().endsWith('/api/orders') && r.method() === 'POST' ); await page.getByRole('button', { name: 'Place order' }).click(); const req = await reqPromise; expect(req.postDataJSON()).toMatchObject({ qty: 2, sku: 'MOU-01' });
20

How do you integrate Playwright with Allure or other reports?

Save to ▾
Show answer
Install the allure-playwright reporter, add it in the config reporters array and generate the report from the allure-results folder in CI.
21

How does URL matching work in page.route?

Save to ▾
Show answer
The first argument can be a glob string, a regular expression or a function that receives a URL object. Globs like '**/api/users*' are simple but * does not cross slashes and ** does. Regex gives precise control over query strings. A predicate function suits complex rules, for example matching host plus a specific search parameter.
22

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.
23

How do you structure environment-specific configs in Playwright?

Save to ▾
Show answer
Use dotenv files per environment, read them in playwright.config and set baseURL and credentials from variables, selecting with an ENV flag.
24

Tell me about a bug you found through API testing that UI tests missed.

Save to ▾
Show answer
Situation: the UI hid a delete button for normal users, so UI tests passed. Task: check permissions properly. Action: I called the delete endpoint directly with a normal user's token and it returned 204. Result: the team fixed the server-side permission check, and I added role-based API tests for every admin endpoint.
25

A feature is controlled by a flag served from a config API. How do you test both states?

Save to ▾
Show answer
Mock the config endpoint in a fixture option so each test chooses the flag value, for example featureFlags: { newCheckout: true }. Run the flow with the flag on and off and assert the different UI. Mocking avoids changing shared environment settings that would affect other testers. Also keep one test against the real config to catch wiring mistakes.
26

Why are screenshot baselines specific to browser and operating system?

Save to ▾
Show answer
Each browser engine lays out and paints text, shadows and form controls slightly differently, and each operating system has its own fonts and smoothing. A Chromium image on Linux will rarely match WebKit on macOS pixel for pixel. That is why Playwright includes project and platform in the file name and why teams fix one rendering environment for baselines.
27

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.
28

How do you attach a screenshot or log to the report from inside a test?

Save to ▾
Show answer
test('report', async ({ page }, testInfo) => { await page.goto('/reports'); await testInfo.attach('report page', { body: await page.screenshot(), contentType: 'image/png', }); await testInfo.attach('meta', { body: 'build 42', contentType: 'text/plain' }); });
29

How do you mock network traffic using a HAR file?

Save to ▾
Show answer
Record once with page.routeFromHAR('data/orders.har', { url: '**/api/**', update: true }) while running against a real server. Later runs replay the saved responses from the HAR instead of hitting the backend. You can edit the stored JSON to create edge cases. Re-record when the API changes, otherwise the replay drifts from reality.
30

Does headless mode behave differently from headed mode?

Save to ▾
Show answer
Modern Chromium headless uses the same browser code as headed, so behaviour is very close. Differences still appear in viewport size, GPU rendering, fonts and some OS dialogs. Tests should set an explicit viewport and not depend on window focus. If something passes headed but fails headless, record a trace and compare screenshots.
31

Describe a time strict TypeScript types caught a bug in your test code.

Save to ▾
Show answer
Situation: our API helpers returned loosely typed objects and tests often read fields that no longer existed. Task: make helpers safer. Action: I added response interfaces, turned on strict mode and replaced any with unknown plus type guards. Result: the compiler immediately showed eleven tests reading a renamed field, which had been passing because they compared undefined with undefined. We fixed them before the next release.
32

What are fixtures and how do you create a custom one?

Save to ▾
Show answer
Fixtures set up and tear down test dependencies. Extend with test.extend({ loggedInPage: async ({ page }, use) => { ...; await use(page); } }).
33

What is the difference between @playwright/test and the playwright package?

Save to ▾
Show answer
@playwright/test is the test runner with fixtures, assertions, parallel workers, retries, reports and config. The playwright package is the automation library alone, used for scripts like scraping or generating PDFs, where you launch browsers yourself. For testing, install @playwright/test. Both share the same browser automation API underneath.
34

What does the open option of the HTML reporter control?

Save to ▾
Show answer
open decides whether the report opens in a browser after the run: 'always', 'never' or 'on-failure', which is the default. In CI you set it to 'never' so the process does not try to start a browser or hang waiting. Locally on-failure is convenient. You can also set the PLAYWRIGHT_HTML_OPEN environment variable instead of editing config.
35

How do you test file upload via API?

Save to ▾
Show answer
Use request.post with multipart: { file: { name, mimeType, buffer } } and assert the response and stored file details.
36

An endpoint should reject invalid email addresses. Which negative tests would you write?

Save to ▾
Show answer
Cover empty string, missing field, null, wrong type such as a number, no at sign, no domain, spaces, very long strings and a duplicate existing email. For each, assert a 400 or 422 status, a clear error message naming the field, and that nothing was created. Also check that a valid email with uppercase letters is accepted.

Companies with offices in Noida (22)

Product

Microsoft

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Noida +2

View questions
Product

Adobe

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Noida, Bengaluru, Gurugram

View questions
Product

Oracle

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Noida +2

View questions
Fintech

Paytm

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Noida, Bengaluru, Mumbai

View questions
Banking & finance

Barclays

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Chennai, Noida +1

View questions
IT services

HCLTech

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Chennai, Bengaluru +2

View questions
IT services

Tech Mahindra

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Hyderabad, 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
IT services

Birlasoft

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Noida, Bengaluru +1

View questions
Consulting

Publicis Sapient

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Gurugram, Noida, Bengaluru

View questions
IT services

GlobalLogic

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Bengaluru, Gurugram +2

View questions
IT services

NTT DATA

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Pune, Noida +2

View questions
IT services

Genpact

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Hyderabad, Bengaluru +2

View questions
Analytics

EXL

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Gurugram, Bengaluru +1

View questions
Hardware & semiconductors

Samsung

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Noida, Delhi

View questions
IT services

Cyient

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Hyderabad, Bengaluru, Noida

View questions
IT services

Happiest Minds Technologies

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Noida

View questions
IT services

Infogain

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Gurugram, Pune +1

View questions
Fintech

Pine Labs

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Bengaluru

View questions
Telecom

Ericsson

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Bengaluru, Chennai +2

View questions
Telecom

Nokia

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Chennai, Noida +1

View questions

Frequently asked questions

Which companies hire Playwright Testing professionals in Noida?

Companies with large offices in Noida include Microsoft, Adobe, Oracle, Paytm, Barclays, HCLTech, Tech Mahindra, Hexaware, Coforge, Birlasoft. Use their company pages below to practise employer-specific sets.

Are Playwright Testing interviews in Noida different from other cities?

The questions depend more on the company than the city. Noida's mix of employers decides the style: Freshers often find their first role here, and many teams run hybrid work

How do I find Playwright Testing jobs in Noida?

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