Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About KPIT Technologies hiring for Playwright Testing roles
KPIT Technologies is a Pune-based software integration partner for the automotive and mobility industry. It works with vehicle makers and suppliers on embedded software, autonomous driving, electric powertrains, connected vehicles and AUTOSAR-based development. In India it hires software, embedded, testing and validation engineers, and many roles suit candidates from electronics, electrical, mechanical and computer science backgrounds with an interest in vehicles.
For Playwright Testing roles, this KPIT Technologies practice set focuses most on JavaScript and TypeScript (9), Playwright Core (7), Framework Design and CI/CD (5), Component Testing (3). It has 17 easy, 23 medium questions, so you can start easy and work up to the harder ones.
Company type
IT services
Headquarters
Pune, India
Main India offices
Pune, Bengaluru
KPIT Technologies Playwright Testing interview process
Online assessment (aptitude + programming)
Technical interview
Managerial round
HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for KPIT TechnologiesStart 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.
Use locator.press('Enter') for a key on a focused element, or page.keyboard.press('Control+A') for page-level shortcuts. Modifiers combine with a plus sign, and ControlOrMeta picks Ctrl on Windows and Linux and Cmd on macOS. keyboard.down and keyboard.up hold keys. Use pressSequentially only when the app needs real keystrokes, such as autocomplete.
02
How do you run the same visual tests at mobile, tablet and desktop sizes?
Create one project per size in playwright.config, for example using devices['Pixel 7'], devices['iPad Mini'] and a desktop viewport, and point them at the same visual test files with testMatch or a tag. Because the project name is part of the baseline file name, each size keeps its own images automatically. This keeps the test code identical while covering responsive layouts.
03
What are union types and type narrowing in TypeScript?
A union type allows several types, such as string | number or 'admin' | 'user'. Before using type-specific methods, you narrow the type with checks like typeof, instanceof, in or comparing a literal field. TypeScript then knows the exact type inside that branch. In tests, unions model options like a role parameter that accepts only known values.
response.ok() returns true when the status code is in the 200 to 299 range. It is a quick success check but not enough on its own. Also assert the exact status, such as 201 for a create, and the body content. For a negative test, assert the specific error status like 400 or 404 and the error message.
a ?? b returns b only when a is null or undefined. Unlike ||, it keeps valid falsy values such as 0, false and an empty string. In config this matters: process.env.RETRIES ?? '2' keeps a value of 0 if someone sets it, whereas || would wrongly replace it. It is often combined with optional chaining.
08
How do you integrate Playwright with Allure or other reports?
Both describe object shapes. Interfaces can be extended and merged; type aliases can also describe unions and primitives. Use interfaces for page or test-data shapes, types for unions.
Component testing mounts a single UI component, such as a React or Vue button or form, in a real browser page and tests it with the normal Playwright API. Playwright bundles the component with Vite, serves it on a small page and gives you a mount fixture. You get real browser rendering and events, which unit tests in jsdom cannot give, while staying much faster than full end-to-end flows. The feature is still marked experimental.
It is the entry file bundled into the component test page, so it runs in the browser before every mount. You import global CSS, fonts and theme files there, and register beforeMount and afterMount hooks to wrap components in providers such as a router, theme or state store. Keeping this setup in one place means individual tests can mount components without repeating boilerplate.
12
What is the difference between workerIndex and parallelIndex?
workerIndex is a unique number for every worker process started during the run, so it keeps growing when a worker is restarted after a failure. parallelIndex is a slot number from 0 to workers minus 1, and a restarted worker reuses its slot. Use parallelIndex, also exposed as TEST_PARALLEL_INDEX, to pick a fixed test account or database per slot.
13
How do you test a site protected by HTTP basic authentication?
Set httpCredentials with a username and password in the use block of the config, or pass it to browser.newContext. Playwright then answers the browser's authentication challenge automatically, so no pop-up appears. Read the values from environment variables rather than hard-coding them. You can also limit the credentials to a specific origin with the origin field.
14
What does the DEBUG=pw:api environment variable do?
Setting DEBUG=pw:api prints detailed logs of every Playwright API call to the terminal, including waits and retries inside actions. It helps when a test hangs and you need to see exactly which step is waiting and why. Other channels such as pw:browser show browser process output. It is noisy, so use it only while investigating.
15
Why are component tests usually faster than end-to-end tests?
They skip the expensive parts: no full app start, no backend calls, no login and no navigation through several pages. Playwright builds the component bundle once and each test simply mounts into an already loaded page. A typical component test finishes in well under a second, so hundreds can run in a pull request check, while end-to-end flows take several seconds each.
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.
19
How do you check that a product list on the page is sorted by price?
const texts = await page.getByTestId('price').allTextContents();
const prices = texts.map(t => Number(t.replace(/[^0-9.]/g, '')));
const sorted = [...prices].sort((a, b) => a - b);
expect(prices).toEqual(sorted);
// wait for the list first with toHaveCount
20
Write a test that logs in and checks the dashboard heading.
Before acting, Playwright waits for the element to be attached, visible, stable, enabled and able to receive events — so manual waits are rarely needed.
23
What are the built-in fixtures page, context, browser and request?
page is a fresh tab for each test. context is the isolated browser context that owns the page, with its own cookies and storage. browser is the shared browser instance for the worker. request is an APIRequestContext for HTTP calls. You ask for them by name in the test function, and Playwright creates and cleans them up automatically.
24
What actionability checks does Playwright run before a click?
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.
25
How do you handle secrets such as passwords and tokens in CI?
Store them in the CI system's secret store and pass them as environment variables, never in the repository or config files. Read them through process.env and fail fast if they are missing. Use dedicated test accounts with limited rights. Avoid printing them in logs, and make sure traces and screenshots do not expose them in reports.
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.
27
What is the difference between page.route and context.route?
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.
28
What is the difference between route.fulfill, route.continue and route.abort?
route.fulfill returns a response you define, such as a status, headers and JSON body, without contacting the server. route.continue sends the request on, optionally with changed URL, method, headers or body. route.abort fails the request with a network error such as 'failed' or 'blockedbyclient'. route.fallback passes it to the next matching handler.
29
What is the difference between page, context and browser?
If you click first and then wait, the response may already have arrived, so the wait misses it and times out. Create the promise first, then act, then await it: const resp = page.waitForResponse('**/api/cart'); await addButton.click(); await resp. waitForRequest works the same way for outgoing requests.
31
An endpoint should reject invalid email addresses. Which negative tests would you write?
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.
A Promise represents a value that will be available later, such as an API response. It is pending at first, then either fulfilled with a value or rejected with an error, and it never changes after that. You consume it with await or then and catch. Almost every Playwright call returns a Promise, which is why tests use await so much.
A worker is a separate operating system process that runs test files. Each worker starts its own browser, and tests inside a worker run one after another, while different workers run at the same time. Workers do not share memory, so you cannot pass variables between them. Worker-scoped fixtures are created once per worker, which is why expensive setup is often placed there.
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.
35
Write code to fill a login form using label-based locators.
Use getByTestId when no user-facing locator is stable or unique, for example icon-only buttons, dynamic grids or canvas wrappers. It matches the data-testid attribute by default, and you can change the attribute name with testIdAttribute in the config. Test ids are very stable but users never see them, so prefer role, label or text first and keep test ids as a fallback.
38
What is the difference between test-scoped and worker-scoped fixtures?
A test-scoped fixture is created and torn down for every test, which keeps tests isolated. A worker-scoped fixture is set up once per worker process and shared by all tests that run in it, which suits expensive things like a started server or a seeded account. Declare it with { scope: 'worker' }. Worker fixtures cannot depend on test fixtures.
maxFailures stops the run after a set number of test failures, for example maxFailures: process.env.CI ? 10 : undefined. If an environment is down and every test fails, the build stops early instead of burning an hour of CI time. Set it high enough that a few real failures still show their full picture.
40
How do you fail a test if the page logs any console error?
Tips to crack the KPIT Technologies Playwright Testing interview
Revise C programming, pointers, embedded systems basics and microcontroller concepts, which are central to many KPIT engineering roles.
Learn the basics of automotive software such as AUTOSAR, CAN communication and electric vehicle components to stand out in discussions.
Prepare to explain any vehicle, robotics or embedded project in detail, including hardware used and how you tested it.
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; KPIT Technologies interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the KPIT Technologies Playwright Testing interview?
Candidates usually go through 4 stages: Online assessment (aptitude + programming); Technical interview; Managerial round; HR 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 KPIT Technologies Playwright Testing interview?
This practice set leans on JavaScript and TypeScript (9), Playwright Core (7), Framework Design and CI/CD (5), Component Testing (3). Revise those first, then practise explaining one or two of your own projects end to end, because most KPIT Technologies interviewers ask you to walk through real work.
Are these the exact questions asked at KPIT Technologies?
No. These are curated practice questions that match the skills and difficulty usually tested in it services interviews like KPIT Technologies's. They are not a leaked or verified list of past questions.
Where does KPIT Technologies hire Playwright Testing professionals in India?
KPIT Technologies has large teams in Pune, Bengaluru. Openings and locations change often, so check the KPIT Technologies careers page and filter by city and experience.
Playwright Testing questions for similar companies