Skip to content

Playwright Testing Interview Questions in Bangalore

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

Playwright Testing jobs in Bangalore

Bangalore (Bengaluru) is India's largest technology hub, with global product companies, engineering centres, unicorn start-ups and big IT-services campuses. Product-company interviews here are usually deeper, with more scenario, design and hands-on rounds.

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

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

What is the difference between page.goto and page.waitForURL?

Save to ▾
Show answer
page.goto starts a navigation to a URL and waits for the load state you choose. page.waitForURL does not navigate; it waits until the current page reaches a URL that matches a string, glob or regular expression, which is useful after a click that redirects, such as a login followed by a jump to the dashboard. Pair it with the click instead of adding fixed sleeps.
02

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

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; }
04

CI runners have 2 CPU cores and workers is set to 8. Tests start timing out randomly. Why?

Save to ▾
Show answer
Eight browsers compete for two cores and limited memory, so pages render slowly, actions hit timeouts and the app under test may also be overloaded. More workers than cores rarely helps. Set workers to match the runner, such as 2, and scale out with shards on more machines instead. Watch CPU and memory metrics in CI to confirm.
05

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

What does the JSON reporter output and how would you use it?

Save to ▾
Show answer
The JSON reporter writes the full suite tree with every test, its status, retries, duration, errors and attachment paths into one file. Teams parse it in scripts to post a summary to chat, to collect flaky tests that passed on retry, or to push results to a database for trends. Set outputFile so the JSON does not mix with console output.
07

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

What is the difference between ES modules and CommonJS?

Save to ▾
Show answer
ES modules use import and export and are the modern standard, loaded statically. CommonJS uses require and module.exports and is the older Node.js style. Playwright supports both, and TypeScript test projects usually write import syntax. Mixing them causes errors such as require is not defined, so set type in package.json and tsconfig consistently.
09

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

What is hoisting?

Save to ▾
Show answer
Declarations of var and functions are moved to the top of their scope at compile time; let and const are hoisted but stay in the temporal dead zone until declared.
11

A test fails with 'Target page, context or browser has been closed'. What usually causes it?

Save to ▾
Show answer
Most often an action was not awaited, so the test finished and Playwright closed the page while the action was still running. Other causes are a test timeout closing the page, the code closing the page or context itself, or the browser crashing. Check the stack for the missing await, look at whether a timeout happened first, and turn on the lint rule for floating promises.
12

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

How do you test the difference between 401 and 403 responses?

Save to ▾
Show answer
401 Unauthorized means the caller is not authenticated, such as a missing or expired token. 403 Forbidden means the caller is known but lacks permission. Test 401 by calling without a token or with an invalid one. Test 403 by calling an admin endpoint with a normal user's token. Assert the status and that no data leaks in the body.
14

How do you publish the Playwright HTML report from a CI pipeline?

Save to ▾
Show answer
Keep the html reporter in the config. After the test step, add an upload-artifact step that runs even when tests fail, using a condition like always(), and upload the playwright-report folder with a retention period. Team members download and open it with npx playwright show-report. Some teams also publish it to static hosting for direct links.
15

How do you use test.step and test annotations?

Save to ▾
Show answer
test.step groups actions into named steps in reports; annotations such as test.skip, test.fixme and test.slow communicate intent and adjust behaviour.
16

What reporters does Playwright provide?

Save to ▾
Show answer
List, dot, line, HTML, JSON and JUnit reporters, plus integrations such as Allure, configurable per environment.
17

Why should you dispose an APIRequestContext?

Save to ▾
Show answer
A context created with request.newContext() holds cookies, connections and stored responses in memory. Calling await context.dispose() frees them, and any later call on it fails. Without disposing, long runs can leak memory. The built-in request fixture is disposed automatically, so this matters for contexts you create in fixtures or helpers.
18

How do you assert the number of rows in a table?

Save to ▾
Show answer
// waits until exactly 5 data rows are rendered const rows = page.getByRole('table').getByRole('row'); await expect(rows).toHaveCount(6); // 1 header + 5 rows // avoid: expect(await rows.count()).toBe(6) // that reads once and does not retry
19

What are global setup and teardown?

Save to ▾
Show answer
Scripts that run once before or after the whole run, for seeding data, starting services or creating authentication state.
20

How can service workers interfere with network mocking?

Save to ▾
Show answer
If the app registers a service worker, it may answer requests from its own cache, so page.route never sees them and mocks seem ignored. Set serviceWorkers: 'block' in the context or config options to turn them off when mocking. If you specifically test offline or PWA caching, keep them enabled and test that behaviour separately.
21

Describe a time you convinced developers to add accessible labels or test ids.

Save to ▾
Show answer
Situation: many inputs had no labels, so our tests relied on long CSS selectors that broke often. Task: get stable hooks without slowing developers. Action: I listed the worst screens, showed how getByLabel tests read and how the same labels help screen reader users, and offered to raise small pull requests myself. Result: the team added labels to new work as a rule and locator breakages dropped sharply.
22

What are discriminated unions and how can they model API responses?

Save to ▾
Show answer
A discriminated union is a union of object types that share one literal field, such as status: 'ok' with data, or status: 'error' with a message. Checking the status field narrows the type, so TypeScript only allows data in the ok branch. In test helpers this forces you to handle the error case and prevents reading fields that do not exist.
23

How do you write data-driven API tests with many inputs?

Save to ▾
Show answer
const cases = [ { email: '', status: 400 }, { email: 'bad', status: 400 }, { email: 'ok@test.in', status: 201 }, ]; for (const c of cases) { test(`signup with '${c.email}'`, async ({ request }) => { const res = await request.post('/api/signup', { data: { email: c.email } }); expect(res.status()).toBe(c.status); }); }
24

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

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

Write a GitHub Actions job that runs the suite in four shards.

Save to ▾
Show answer
jobs: e2e: runs-on: ubuntu-latest strategy: fail-fast: false matrix: shard: [1, 2, 3, 4] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - run: npm ci && npx playwright install --with-deps - run: npx playwright test --shard=${{ matrix.shard }}/4 --reporter=blob - uses: actions/upload-artifact@v4 with: name: blob-${{ matrix.shard }} path: blob-report
27

What is the difference between beforeEach and fixtures?

Save to ▾
Show answer
beforeEach runs the same code before every test in scope; fixtures are lazy, composable and only set up what a test uses.
28

What are the serial and parallel modes of test.describe.configure?

Save to ▾
Show answer
test.describe.configure({ mode: 'serial' }) runs tests in order in one worker, and if one fails the rest are skipped. mode: 'parallel' lets tests in one file run across workers. Serial mode suits a true step-by-step flow, but it makes tests depend on each other, so prefer independent tests and use serial only when there is no alternative.
29

How do you validate JSON schema?

Save to ▾
Show answer
Use a library such as zod or ajv to define the expected schema and parse the response to fail on missing or wrongly typed fields.
30

Write a test that updates a user with PUT and verifies the change.

Save to ▾
Show answer
test('update user', async ({ request }) => { const res = await request.put('/api/users/12', { data: { name: 'Neha', city: 'Jaipur' }, }); expect(res.status()).toBe(200); const get = await request.get('/api/users/12'); expect(await get.json()).toMatchObject({ name: 'Neha', city: 'Jaipur' }); });
31

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

What can automated accessibility tools not catch?

Save to ▾
Show answer
Scanners like axe find rule-based problems such as missing labels, bad contrast or invalid ARIA, which is roughly a third to a half of real issues. They cannot judge whether alt text is meaningful, whether focus order makes sense, whether error messages are understandable, or whether a screen reader user can actually finish the task. So automated scans are combined with keyboard tests and periodic manual checks with screen readers.
33

How do you run tests in parallel and control workers?

Save to ▾
Show answer
Files run in parallel by default; set workers in the config and use test.describe.configure({ mode: 'parallel' }) for tests inside a file.
34

How do you record a trace manually with the tracing API?

Save to ▾
Show answer
Call await context.tracing.start({ screenshots: true, snapshots: true }) before the steps, and await context.tracing.stop({ path: 'trace.zip' }) after them. This is useful in scripts that use the library without the test runner, or when you want a trace of only part of a flow. tracing.group can label sections of steps.
35

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

How do you handle iframes in Playwright?

Save to ▾
Show answer
Use page.frameLocator('#frame').getByRole(...) so actions work inside the iframe with auto-waiting.

Companies with offices in Bangalore (134)

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

Meta

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Gurugram, Bengaluru, Hyderabad +1

View questions
Product

Microsoft

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Noida +2

View questions
Hardware & semiconductors

Apple

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Mumbai +1

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
Product

Salesforce

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Mumbai +1

View questions
Product

ServiceNow

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru

View questions
Product

Atlassian

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru

View questions
Fintech

Intuit

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru

View questions
Hardware & semiconductors

Cisco

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Pune, Chennai

View questions
Product

LinkedIn

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Gurugram, Mumbai

View questions
Product

Uber

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Gurugram

View questions
E-commerce & consumer tech

Walmart

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Chennai, Gurugram

View questions
E-commerce & consumer tech

Flipkart

Playwright Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad

View questions
E-commerce & consumer tech

Swiggy

Playwright Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad

View questions

Frequently asked questions

Which companies hire Playwright Testing professionals in Bangalore?

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

Are Playwright Testing interviews in Bangalore different from other cities?

The questions depend more on the company than the city. Bangalore's mix of employers decides the style: Product-company interviews here are usually deeper, with more scenario, design and hands-on rounds

How do I find Playwright Testing jobs in Bangalore?

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