Skip to content

BigBasket Playwright Testing Interview Questions & Answers

Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.

About BigBasket hiring for Playwright Testing roles

BigBasket is an Indian online grocery company, majority owned by the Tata Group, that delivers fruits, vegetables, staples and household products. It runs scheduled delivery and quick commerce services such as BB Now across many cities. Its Bengaluru technology and business teams hire software engineers, data analysts, data scientists, supply chain analysts and product managers.

For Playwright Testing roles, this BigBasket practice set focuses most on Playwright Core (7), Fixtures and Hooks (6), Parallel Runs, Sharding & Reporting (5), API Testing (5). It has 3 easy, 29 medium, 8 hard questions, so you can start easy and work up to the harder ones.

Company type
E-commerce & consumer tech
Headquarters
Bengaluru, India
Main India offices
Bengaluru

BigBasket Playwright Testing interview process

  1. Online coding or analytics assessment
  2. Technical round 1
  3. Technical round 2 (design or case)
  4. Hiring manager round

Typical pattern based on public candidate experiences. Rounds vary by role, team and year.

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

Write a beforeEach hook that opens the home page and accepts the cookie banner.

Save to ▾
Show answer
test.beforeEach(async ({ page }) => { await page.goto('/'); const accept = page.getByRole('button', { name: 'Accept cookies' }); if (await accept.isVisible()) { await accept.click(); } });
02

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

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

Baselines are always rendered in Docker, yet the repo has separate Windows and Linux image files. How do you keep one baseline per browser?

Save to ▾
Show answer
The default file name includes the platform, so a developer who updated baselines on Windows created a second set. Set snapshotPathTemplate in the config without the {platform} token, for example '{testDir}/__screenshots__/{testFilePath}/{arg}-{projectName}{ext}', delete the stray files and only update baselines through the Docker command or a CI job. Document the rule so it does not happen again.
05

How do you mock network requests?

Save to ▾
Show answer
page.route('**/api/items', route => route.fulfill({ json: [...] })) intercepts and replies with test data; route.abort() simulates failures.
06

Component tests fail because imports like @/utils cannot be resolved, though the app builds fine. How do you fix it?

Save to ▾
Show answer
The app uses a bundler alias that the component test bundle does not know. Add the same alias in ctViteConfig under resolve.alias, or reuse the project's Vite config by importing it. Also make sure tsconfig paths match, so editors and type checks agree. After that, clear the cache folder that the component bundler writes under playwright/.cache so the bundle rebuilds.
07

One shard finishes in 4 minutes and another takes 15. How do you balance them?

Save to ▾
Show answer
Check whether fullyParallel is off, because file-level sharding puts big files together. Turn it on if tests are independent, or split the largest files. Use reportSlowTests and the merged report's durations to find heavy files, and move slow setup into API calls or shared storage state. Also check that one shard is not getting all the tests of a slow project such as WebKit.
08

What is the difference between click and dispatchEvent?

Save to ▾
Show answer
click simulates a real user click with actionability checks; dispatchEvent fires a DOM event directly without those checks.
09

A third-party analytics script makes tests slow and flaky. What do you do?

Save to ▾
Show answer
Block it in tests with context.route on its domain and route.abort, or fulfill it with an empty script. Analytics is not what you are testing, and blocking it removes delays and random network errors. If tracking events matter, write a few separate tests that capture the requests with waitForRequest and assert their parameters.
10

How do you run tests on mobile viewports?

Save to ▾
Show answer
Use device descriptors such as devices['iPhone 13'] in a project config to emulate viewport, user agent and touch.
11

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

How do you send authentication headers?

Save to ▾
Show answer
Set extraHTTPHeaders in the config or pass headers per request, for example Authorization: Bearer token fetched in a setup step.
13

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

Parallel tests create users with the same email and fail with 'already exists'. How do you fix it?

Save to ▾
Show answer
Generate unique data per test, for example by adding testInfo.testId, the parallel index or a random suffix to the email, or by using a data builder that creates a fresh user through the API. Avoid hard-coded shared records in test files. Clean up created users in a fixture teardown so the database does not fill up over time.
15

What is the Playwright Inspector and how do you open it?

Save to ▾
Show answer
The Inspector is a debug window that lets you step through test actions one by one, see the locator being used and highlight it on the page. Open it with npx playwright test --debug, with PWDEBUG=1, or by calling page.pause(). It runs headed with no timeout, so you can explore the page at each step and edit locators live.
16

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

Describe a time you improved how test results were reported to the team or managers.

Save to ▾
Show answer
Situation: managers only heard pass or fail and could not tell flaky tests from real bugs. Task: make results useful. Action: I added a custom reporter that posted a short summary to our team chat with failures, flaky tests and a report link, and a weekly trend of flake rate. Result: flaky tests dropped by half in two months because owners could see them.
18

An axe scan reports 40 violations on a legacy page. How do you add accessibility checks without blocking every build?

Save to ▾
Show answer
Record the current violations as a known baseline, for example by snapshotting violation ids and targets, and fail only on new ones. Fix the worst issues first, such as missing labels and contrast on key flows, and shrink the baseline every sprint. Make new pages and components meet zero violations from day one. Report the trend to the team so the debt is visible rather than silently ignored.
19

How do you provide page objects as fixtures?

Save to ▾
Show answer
type Pages = { loginPage: LoginPage; cartPage: CartPage }; export const test = base.extend<Pages>({ loginPage: async ({ page }, use) => { await use(new LoginPage(page)); }, cartPage: async ({ page }, use) => { await use(new CartPage(page)); }, }); // test('x', async ({ loginPage }) => { ... })
20

Write a component test for a Counter that increments on click.

Save to ▾
Show answer
import { test, expect } from '@playwright/experimental-ct-react'; import { Counter } from './Counter'; test('increments on click', async ({ mount }) => { const component = await mount(<Counter initial={2} />); await component.getByRole('button', { name: 'Add' }).click(); await expect(component.getByTestId('count')).toHaveText('3'); });
21

Why turn on strict mode in tsconfig for a test project?

Save to ▾
Show answer
strict enables checks such as strictNullChecks and noImplicitAny. They catch bugs like using a value that may be undefined, missing parameters or wrong property names before tests run. In a large suite this saves debugging time and makes page objects safer to refactor. Pair it with the no-floating-promises lint rule to catch missing awaits.
22

How do you rerun only the tests that failed in a sharded CI run?

Save to ▾
Show answer
--last-failed works only on the machine that kept the .last-run.json file, so it does not help across shards. Instead collect the failed tests from the merged JSON report or the blob reports, then run them in a follow-up job by file and line or with --grep on their titles. Many teams simply rely on retries and treat any test needing a rerun as flaky.
23

How do you validate response headers?

Save to ▾
Show answer
Use response.headers() for an object of lower-cased header names, or headersArray() for duplicates. Assert content-type contains application/json, cache-control matches the policy, and security headers such as strict-transport-security are present. Also check that sensitive headers like server version are not exposed. Header checks catch configuration bugs that body checks miss.
24

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

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

How do test.slow() and longer timeouts help or hurt debugging?

Save to ▾
Show answer
test.slow() triples the timeout for a test that is genuinely long, such as a report export. It is honest and visible in code. But raising timeouts to make a flaky test pass hides the real cause, such as a missing wait or slow backend, and makes failures take longer. Investigate the trace first and change timeouts only with a reason.
27

How do you handle shadow DOM?

Save to ▾
Show answer
Playwright locators pierce open shadow roots by default, so getByRole and CSS locators work without special handling.
28

Show a config with a setup project and a browser project that reuses its login.

Save to ▾
Show answer
projects: [ { name: 'setup', testMatch: /auth\.setup\.ts/ }, { name: 'chromium', use: { ...devices['Desktop Chrome'], storageState: '.auth/user.json' }, dependencies: ['setup'], }, ],
29

How do you test file downloads and verify their content?

Save to ▾
Show answer
Capture the download event, save it with download.saveAs, then read the file in Node and assert on name, size or content.
30

How do you test that duplicate POST requests do not create duplicate orders?

Save to ▾
Show answer
If the API supports an idempotency key header, send the same POST twice with the same key and assert one order exists and both responses return the same id. Send it with different keys and expect two orders. Also try concurrent requests with Promise.all to check race conditions. Without a key, document the risk to the team.
31

How do you test geolocation, permissions and time zones?

Save to ▾
Show answer
Set them in the context options (geolocation, permissions, timezoneId, locale) to simulate users from other regions.
32

A beforeAll creates one user and tests in the same file fail randomly in parallel mode. Why?

Save to ▾
Show answer
With fullyParallel, the file's tests run in different workers, so each worker creates its own user, or tests in one worker share one user and change its state. Shared mutable data causes random failures. Give each test its own data through a test-scoped fixture, or create a unique user per worker with workerInfo.workerIndex in the name.
33

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

What is the difference between page.route and context.route?

Save to ▾
Show answer
page.route applies only to requests from that page. context.route applies to every page in the browser context, including pop-ups and new tabs opened later. Use context.route when a flow opens new windows, such as a payment pop-up, or when you set up mocks in a fixture before the page exists. Page routes take priority over context routes.
35

How do you share one authenticated API context across all tests in a worker?

Save to ▾
Show answer
Create a worker-scoped fixture that calls request.newContext with baseURL and an auth header, or logs in through the API and keeps the cookies. Pass it to use, and dispose it after use returns. Every test in that worker gets the same ready context, so login happens once per worker. Do not store per-test data on it, or tests start depending on each other.
36

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

How do you balance pressure to automate quickly against writing stable tests?

Save to ▾
Show answer
Situation: a manager wanted 50 tests for a release in one week. Task: deliver without creating a flaky suite. Action: I agreed on the 20 highest-risk flows first, used stable locators and shared fixtures, and listed the rest as follow-ups. Result: the 20 tests ran green in CI from day one and the rest were added next sprint.
38

Write a test that checks keyboard Tab order through a login form.

Save to ▾
Show answer
test('login form is keyboard friendly', async ({ page }) => { await page.goto('/login'); await page.getByLabel('Email').focus(); await page.keyboard.press('Tab'); await expect(page.getByLabel('Password')).toBeFocused(); await page.keyboard.press('Tab'); await expect(page.getByRole('button', { name: 'Sign in' })).toBeFocused(); await page.keyboard.press('Enter'); });
39

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); }, });
40

How can you apply extra CSS only while a screenshot is taken?

Save to ▾
Show answer
Pass the stylePath option to toHaveScreenshot or set it in the expect.toHaveScreenshot section of the config. The stylesheet is injected just for the capture, so you can hide scrollbars, freeze a carousel, or set visibility hidden on dynamic widgets without changing the app. It is cleaner than adding test-only classes and also works when a mask box would cover too much of the layout.

Tips to crack the BigBasket Playwright Testing interview

  • Practise DSA for engineering roles, and SQL plus Excel for analyst roles, as these are commonly tested in screening.
  • Think through grocery supply chain problems like demand forecasting, inventory freshness and delivery slot planning before case rounds.
  • Use the BigBasket app and note improvement ideas, which helps in product sense and why-BigBasket discussions.
  • Keep a one-minute story ready for every project on your CV: problem, your part, tools, result.
  • Practise the hard questions on this page aloud; BigBasket interviewers usually ask follow-ups on your first answer.

Frequently asked questions

How many rounds are there in the BigBasket Playwright Testing interview?

Candidates usually go through 4 stages: Online coding or analytics assessment; Technical round 1; Technical round 2 (design or case); Hiring manager round. The exact rounds change with the role, team, location and your experience, so confirm the process with the recruiter.

Which topics should I prepare for the BigBasket Playwright Testing interview?

This practice set leans on Playwright Core (7), Fixtures and Hooks (6), Parallel Runs, Sharding & Reporting (5), API Testing (5). Revise those first, then practise explaining one or two of your own projects end to end, because most BigBasket interviewers ask you to walk through real work.

Are these the exact questions asked at BigBasket?

No. These are curated practice questions that match the skills and difficulty usually tested in e-commerce & consumer tech interviews like BigBasket's. They are not a leaked or verified list of past questions.

Where does BigBasket hire Playwright Testing professionals in India?

BigBasket has large teams in Bengaluru. Openings and locations change often, so check the BigBasket careers page and filter by city and experience.

Playwright Testing questions for similar companies