QA Interview
Playwright Debugging Interview Questions for Senior QA (2026)
Practice Playwright debugging interview questions for senior QA roles, with model answers on traces, locators, retries, networks, CI, and test design.
23 min read | 4,394 words
TL;DR
Strong senior answers show a repeatable investigation method: reproduce, classify, collect evidence, isolate one variable, fix the root cause, and add prevention. Be precise about Playwright tools such as Trace Viewer, Inspector, web-first assertions, projects, retries, and API-level observability.
Key Takeaways
- Start every investigation by classifying the failure before changing the test.
- Use traces, call logs, screenshots, video, console output, and network evidence together.
- Treat retries as a diagnostic signal, not as a repair for nondeterministic tests.
- Prefer web-first assertions and resilient locators over sleeps and broad selectors.
- Reproduce CI conditions locally by matching browser, workers, data, permissions, and environment.
- Explain both the immediate fix and the system change that prevents recurrence.
Playwright debugging interview questions for senior QA roles test more than API recall. Interviewers want to hear how you turn an intermittent symptom into evidence, isolate the responsible layer, protect delivery, and prevent the same class of failure from returning.
A strong response names the artifact you would inspect, the hypothesis it tests, and the decision you would make next. Use this hub to practice that reasoning, then sharpen adjacent skills with the Playwright scenario-based interview questions and Playwright coding interview questions.
TL;DR
| Failure signal | First evidence | Senior-level next move |
|---|---|---|
| Element timeout | Call log and trace DOM snapshot | Check actionability, locator scope, and preceding state |
| CI-only failure | CI trace, project config, worker count | Reproduce the same environment and concurrency |
| Random pass on retry | First-attempt trace and test history | Classify shared state, timing, data, or product race |
| API-dependent UI hang | Network events and response body | Separate backend latency, contract failure, and UI handling |
| Browser-specific failure | Project-specific trace and console | Compare capability, CSS, permissions, and browser behavior |
The compact method is reproduce -> classify -> observe -> isolate -> repair -> prevent. Do not begin by increasing a timeout. A senior engineer first determines whether the problem belongs to the test, application, environment, data, or tooling.
1. Playwright Debugging Interview Questions for Senior QA: Investigation Strategy
Q: A test fails once in twenty runs. What do you do first?
Run the same test repeatedly with its original configuration and retain artifacts from every failure, including the first attempt. Compare passing and failing traces at the last known-good action, looking for different network completion, DOM state, data, or worker interference. Vary one factor at a time, such as workers, browser, seed, or environment, because changing several variables destroys causality. Record the smallest reproduction and assign the failure to application, test, data, infrastructure, or runner before proposing a fix.
Q: How do you distinguish a product bug from a test bug?
Inspect what a user-visible requirement says should happen, then compare it with the trace, network contract, and DOM. If the application receives valid input but renders the wrong state, the defect is likely in the product; if the test targets an ambiguous element or skips a prerequisite, the automation is wrong. Reproduce outside the test only when that adds evidence, since a Playwright trace may already prove the browser behavior. File the result with concrete inputs and observed output instead of using the vague label flaky.
Q: What does a useful debugging hypothesis look like?
It is falsifiable and tied to an observation: "The save button remains disabled because the validation request returns after the assertion timeout." You would test it by inspecting request timing and the disabled attribute in the same trace. "There is a timing issue" is not useful because it neither identifies an event nor predicts evidence. A good hypothesis narrows the next experiment and has an explicit disconfirming result.
Q: When should you use a minimal reproduction?
Create one when framework behavior is unclear, the full scenario has too many dependencies, or you need to separate Playwright from application code. Preserve only the failing interaction, relevant configuration, and deterministic setup. If removing authentication makes the failure disappear, that is a clue rather than permission to omit it permanently. A compact reproduction is also the best artifact for an upstream issue because maintainers can run it without your private system.
Q: How do you prioritize several failures after a pipeline run?
Group failures by shared signature, first broken step, project, and infrastructure event instead of counting every red test as independent. Investigate the earliest common dependency, such as login setup or a failed deployment health check, before downstream assertions. Separate deterministic regressions from intermittent failures and quarantine only under an owned, time-bounded policy. This keeps one outage from producing dozens of duplicate investigations.
2. Trace Viewer and Artifact Analysis
Q: What does a Playwright trace contain, and why is it valuable?
A trace can include action timelines, DOM snapshots, screenshots, source locations, network activity, console messages, and metadata. It lets you inspect the page before and after each action rather than infer state from the final screenshot. The action call log is especially useful for seeing auto-waiting and actionability checks. Use traces for retained forensic evidence, while using Inspector for a live local investigation.
Q: How would you configure traces for CI without excessive storage?
Use trace: 'on-first-retry' as a practical default so a failed first attempt produces a trace during its retry. Pair it with a retention policy in the CI artifact store and upload only relevant test output. For highly critical suites, retain-on-failure can capture initial failures without tracing every pass. The exact choice should follow failure frequency, artifact cost, and whether first-attempt evidence is required.
import { defineConfig } from '@playwright/test';
export default defineConfig({
retries: process.env.CI ? 1 : 0,
use: {
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure'
}
});
Q: A screenshot looks correct, but the click timed out. What do you inspect?
Read the actionability log for visibility, stability, event reception, and enabled state. Then inspect the DOM snapshot at the click, not just the screenshot, because an invisible overlay may intercept pointer events or the target may be detached and recreated. Compare the locator resolution over time and inspect CSS or animation state. A static image cannot show repeated re-rendering or identify the element receiving the event.
Q: When is video more useful than a trace?
Video helps explain continuous motion, drag behavior, animation, or a visual sequence to someone who does not have the trace tooling. It is also useful when a failure depends on perception across several moments. Trace Viewer is normally stronger for exact selectors, network events, source, and DOM snapshots. Retain both selectively when a complex gesture or visual transition is under investigation.
Q: How do you debug a trace from a remote CI job?
Download the trace archive as a build artifact and open it with npx playwright show-trace path/to/trace.zip. Confirm that the artifact belongs to the failed project, retry, and shard before drawing conclusions. Inspect the timeline from the last successful assertion through the failure, then correlate browser console and network timing. Never unzip and edit the archive, because Trace Viewer expects its recorded structure. See the focused Playwright trace on retry guide for a reproducible setup.
3. Locator and Actionability Failures
Q: Why can a locator pass locally but fail in CI?
The locator may depend on viewport, locale, data order, feature flags, or a race hidden by a slower or faster environment. Compare project settings and the resolved element in both traces. Check whether duplicate accessible names appear only with CI data and whether responsive markup changes the rendered control. Fix the environmental assumption or strengthen the semantic scope rather than switching immediately to a CSS path.
Q: How do you debug strict mode violations?
A strictness error means an operation requiring one element resolved to multiple candidates. Use the error's matched-element list and inspect why the accessible name or test id is duplicated. Narrow by a meaningful container, role, or exact label, such as a row representing a known account. Avoid first() unless the first item is itself the requirement, because it converts ambiguity into an order dependency.
Q: What is your approach when an element is visible but not clickable?
Check whether it is stable, enabled, and able to receive pointer events. Inspect overlays, sticky headers, animations, and element replacement in the action log and DOM snapshot. If the application intentionally animates, wait for an observable completed state rather than a duration. Use force: true only when the test explicitly needs to bypass user actionability, since it can conceal a real usability defect.
Q: How would you repair a brittle nth-based locator?
Identify the domain property that selects the intended item, such as a customer name or order number, and filter the collection by that property. Then locate the action within that scoped row or card. This survives sorting and inserted records, whereas nth(2) silently selects a different entity. If no stable user-facing identity exists, collaborate with developers on a purposeful test id.
const order = page.getByRole('row').filter({ hasText: 'ORD-1042' });
await expect(order).toContainText('Ready');
await order.getByRole('button', { name: 'Ship' }).click();
Q: What locator priority do you recommend?
Start with user-facing roles, names, labels, placeholders, and text because they align the test with accessible behavior. Use a test id for controls whose identity is not expressed reliably to users, especially icon-only or highly dynamic structures. CSS can be appropriate for stable structural assertions but should not mirror implementation-heavy class chains. XPath is not automatically wrong, yet it rarely improves maintainability in a component application. The Playwright locator filter examples show how to scope repeated content safely.
4. Waiting, Timeouts, and Asynchrony
Q: Why is waitForTimeout usually a debugging smell?
A fixed sleep waits too long when the system is fast and still fails when it is slower than the chosen delay. It also hides which readiness condition matters. Replace it with a locator assertion, URL assertion, response predicate, or application state that reflects the requirement. A short sleep can be a temporary experiment to confirm a race, but it should not become the repair.
Q: How do action and assertion timeouts differ?
An action timeout governs operations such as clicks and fills when configured, while an expect timeout controls retrying web-first assertions. The overall test timeout bounds the entire test, including hooks and actions. Diagnose which clock expired from the error and call log before changing configuration. Increasing the test timeout cannot repair a locator that never becomes unique.
Q: A response arrives, but the UI assertion still fails. Why?
Network completion does not guarantee that the frontend has parsed the body, updated state, completed rendering, and exposed the final accessible UI. Await the triggering action and use a web-first assertion on the resulting user state. Inspect console errors and response content for a successful HTTP status carrying an invalid business payload. If you await a response, register the wait before the action so the event cannot be missed.
const responsePromise = page.waitForResponse(response =>
response.url().endsWith('/api/orders') && response.request().method() === 'POST'
);
await page.getByRole('button', { name: 'Create order' }).click();
const response = await responsePromise;
expect(response.ok()).toBeTruthy();
await expect(page.getByRole('status')).toHaveText('Order created');
Q: How do you investigate a test timeout with no obvious failed line?
Check the report and trace for the last started operation, then inspect hooks, fixtures, and unresolved promises. A missing await, a listener that never resolves, or an afterEach cleanup can consume the remaining test budget. Run the test alone with verbose API logs and reduce it until the hanging promise is visible. The fix Playwright test timeout guide covers the distinct timeout scopes.
Q: When is networkidle a poor readiness signal?
Applications with polling, analytics, WebSockets, or background refresh may never become idle, while a page can become temporarily idle before required UI work finishes. Prefer a specific heading, loaded record, enabled control, or response tied to the behavior under test. networkidle expresses transport quietness, not business readiness. Use it only when the application's network lifecycle genuinely defines completion.
5. Flakiness, Retries, and Isolation
Q: What does a test passing on retry tell you?
It tells you the outcome is nondeterministic under the observed conditions, not that the suite is healthy. Compare first-attempt and retry traces for data, cache, timing, worker, and environment differences. A retry may also alter state because the first attempt partially completed the workflow. Track flaky classification separately and keep ownership visible until the cause is removed.
Q: How do you detect shared-state pollution?
Run the test alone, then after suspected predecessors, and compare parallel with serial execution. Look for reused accounts, mutable server records, shared files, global variables, and storage state that tests modify. Give each worker or test a unique data namespace and clean up through APIs when feasible. A failure that follows order or worker count strongly suggests isolation debt.
Q: Should a flaky test be quarantined?
Quarantine is appropriate when the test blocks delivery disproportionately and the risk is understood, but it must have an owner, defect, deadline, and alternative coverage. Keep it running in a non-blocking lane so evidence continues to accumulate. Do not silently skip it or add unlimited retries. Critical-path coverage may require fixing or replacing the test before allowing deployment.
Q: How do you make test data deterministic?
Create the exact preconditions through an API or controlled fixture and use unique identifiers derived from the test or worker. Avoid relying on whatever record happens to exist in a shared environment. Freeze time with Playwright's clock support when date behavior is the subject and the app permits it. Clean up only data your test owns so parallel runs cannot delete each other's state.
Q: How do retries interact with hooks and fixtures?
A failed test is retried in a fresh worker process in common Playwright Test behavior, so worker-scoped setup may run again. Test-scoped fixtures and hooks also execute for each attempt, which can duplicate data unless creation is idempotent or uniquely named. Review setup and teardown evidence for the retry itself rather than assuming the same context survived. Design fixtures so a partially failed attempt cannot poison the next one.
6. Network, API, and Authentication Debugging
Q: How do you debug an unexpected 401 in a UI test?
Inspect the failing request's URL, headers, cookies, response body, and timing. Verify that storage state was created for the same origin and environment, and check token expiry or clock skew. Determine whether the application omitted credentials, the server rejected them, or a redirect moved the page to another origin. Re-authenticate through a controlled setup project rather than masking the response with a route stub.
Q: A mocked route is not intercepting. What do you check?
Confirm that page.route or context.route is registered before navigation or the triggering action. Compare the actual URL and method with the glob or predicate, including query strings and service-worker behavior. Ensure another route handler is not fulfilling the request first and that the request belongs to the expected page or context. Use request logging briefly to reveal the exact traffic instead of guessing the pattern.
Q: How do you decide whether to mock a backend dependency?
Mock when the test needs deterministic rare states, contract-controlled errors, or isolation from an unavailable third party. Keep at least one integration path against the real service for confidence in wiring and contracts. Make the mocked payload conform to the published schema and test application behavior, not the mock library itself. Over-mocking can produce a fast suite that never detects authentication, serialization, or deployment failures.
Q: How do you capture network evidence without leaking secrets?
Log method, sanitized URL, status, duration, and a request correlation id while redacting authorization, cookies, tokens, and sensitive bodies. Restrict artifact access and retention because traces can contain page and network data. Prefer server-side correlation through an approved identifier over dumping every header. Security and debugging must share an explicit artifact policy.
Q: What would you inspect when an API returns 200 but the test fails?
Check the response schema and business status rather than equating HTTP success with correct behavior. Inspect empty arrays, stale versions, partial errors, and unexpected content types. Then determine whether the frontend transforms or caches the payload incorrectly. Assert only the contract relevant to the scenario, since snapshotting a huge body creates noisy failures without better diagnosis. The Playwright APIRequestContext examples are useful for separating setup API failures from browser behavior.
7. CI, Parallelism, and Environment-Specific Failures
Q: A test fails only in CI. How do you reproduce it?
Match the CI browser build, operating system image, environment variables, locale, timezone, viewport, headless mode, worker count, shard, and application revision. Run the same command in the same container when available. Download the original trace before rerunning because subsequent attempts may change server data. If local reproduction remains impossible, add narrow observability around the leading hypothesis rather than broad unredacted logging.
Q: How can parallel execution expose hidden defects?
Workers can collide on accounts, records, rate limits, ports, files, or singleton backend state. Parallel load may also reveal real application races that serial tests conceal. Compare behavior with one worker and several workers, then assign unique resources using worker identity or server-generated ids. Do not solve every collision by disabling parallelism, because that preserves the underlying coupling and lengthens feedback.
Q: What causes browser-project-specific failures?
Rendering engines differ in event behavior, layout, codecs, permissions, and implementation details, while project configuration may also vary device settings or locale. Inspect the failing project's trace and console rather than assuming Chromium evidence applies. Confirm the feature is supported and the expected behavior is cross-browser. Use project-specific expectations only for an intentional product difference, not to excuse an unexplained failure.
Q: How do you debug resource pressure in CI?
Correlate failure timing with CPU, memory, disk, browser crashes, and worker count. Symptoms include broad timeout inflation, closed pages, missing artifacts, and unrelated tests failing together. Reduce workers as a controlled experiment and right-size the executor or split shards based on measured duration. A global timeout increase may make pressure worse by keeping overloaded processes alive longer.
Q: What configuration drift matters most?
Base URL, feature flags, credentials, time zone, locale, proxy settings, browser version, and service endpoints can all change observable behavior. Print a sanitized configuration summary at run start and version the test environment with the application. Fail early when required variables are absent instead of falling back to a surprising default. Treat configuration as evidence attached to the run, not tribal knowledge.
8. Frames, Popups, Downloads, and Complex UI
Q: How do you debug a locator inside an iframe?
First prove the element belongs to a frame and identify the frame by stable URL, name, or owning element. Use frameLocator to keep operations scoped and inspect whether navigation replaced the frame. Cross-origin content is still automatable through Playwright, but application and browser policies may affect behavior. A page-level locator will not search inside the frame document.
Q: Why can a popup event be missed?
The listener was often registered after the click that opened the window. Create the waitForEvent('popup') promise before triggering the action, then await both in order. Confirm whether the application opens a page, reuses the current tab, or is blocked before assuming a popup exists. After capture, wait for a meaningful element or URL in the new page.
Q: How do you verify downloads reliably?
Start page.waitForEvent('download') before the click and inspect suggestedFilename() or save the file to a test-owned temporary path. Validate meaningful content when the requirement concerns the exported data, not merely that a download began. Remember that temporary download files are tied to the browser context lifecycle. Avoid fixed shared filenames that collide under parallel execution.
Q: A drag-and-drop test is inconsistent. What evidence helps?
Use video to see motion and trace snapshots to inspect source and target geometry. Check whether the elements are stable, within the viewport, and backed by native drag events or a custom pointer implementation. Prefer Playwright's dragTo when the application supports standard behavior. For custom canvases, test the smallest accurate pointer sequence and assert the final domain state.
Q: How do you debug a virtualized list?
Recognize that offscreen records may not exist in the DOM, so a locator cannot find them until scrolling causes rendering. Scroll the relevant container incrementally or use the application's search/filter capability, then assert the identified row. Avoid counting DOM nodes as the total dataset. Distinguish a missing business record from a record that is simply outside the rendered window.
9. Debugging Test Architecture and Fixtures
Q: How can a Page Object hide the root cause?
A large method may wrap navigation, waits, clicks, and assertions, leaving the report with a vague business action. Break it into cohesive operations and use test.step where the report benefits from domain labels. Keep assertions close to the behavior they verify or clearly expose them through component objects. Do not catch and replace Playwright errors unless you preserve the original stack and call log.
Q: What makes a fixture debuggable?
Its scope, inputs, ownership, and teardown are explicit. It emits safe identifiers for created resources, fails near the setup operation, and does not conceal environment fallbacks. Keep fixture responsibilities narrow so a failure points to authentication, data creation, or browser setup rather than one universal fixture. Idempotent cleanup should tolerate a resource that was never fully created.
Q: When would you add custom attachments?
Attach domain evidence that Playwright does not already capture, such as a sanitized server correlation record, seeded entity id, or application state summary. Name the attachment for the test step and use an appropriate content type. Avoid duplicating entire traces or exposing secrets. Each attachment should answer a recurring diagnostic question that otherwise requires another run.
Q: How do soft assertions affect debugging?
Soft assertions let a test collect multiple discrepancies before ending, which is useful for related visual or content checks. They can also allow later actions to execute on invalid state and produce misleading secondary failures. Inspect test.info().errors or ensure the flow stops before a destructive dependency when earlier correctness is essential. Use hard assertions for gates and soft assertions for independent observations.
Q: How do you debug global setup failures?
Run the setup project directly and retain its report, trace, and API diagnostics just like any test. Validate required secrets and target health before creating shared state. Keep setup idempotent and avoid one global account that all workers mutate. A setup failure should report the failed dependency precisely rather than causing every browser test to appear broken.
10. Senior Ownership, Prevention, and Communication
Q: What belongs in a high-quality defect report from an automated failure?
Include the application revision, environment, browser project, exact data identity, minimal steps, expected result, observed result, and the smallest safe artifact proving the issue. Link the trace or sanitized excerpt and state reproducibility. Separate facts from hypotheses so developers can trust the report. If automation itself is wrong, track the test repair without filing a misleading product defect.
Q: How do you measure flakiness responsibly?
Track first-attempt failures and retry outcomes by stable test id over a defined run window. Segment by browser, environment, worker, and failure signature so infrastructure outages do not inflate every test's rate. Report both frequency and impact, because a rare checkout failure may deserve higher priority than a noisy low-risk check. Never use retry-adjusted green status as the only quality metric.
Q: What prevention follows a fixed race condition?
Add an assertion or synchronization point tied to the true readiness contract, plus a focused regression that fails under the old behavior. Review similar components or helpers for the same assumption. Improve observability if the investigation lacked correlation or state evidence. Document the cause in the fix so a future timeout increase does not reintroduce the race.
Q: How do you explain a debugging trade-off to delivery stakeholders?
State the release risk, evidence strength, blast radius, and options in plain language. For example, quarantining a noncritical flaky visual check may restore signal today, while a checkout race requires a release decision because user impact is plausible. Give an owner and time for the permanent action. Avoid presenting all red tests as equal or promising certainty the evidence does not support.
Q: What signals distinguish a senior debugger from a mid-level engineer?
A senior engineer manages the system around the failure, not only the failing line. They preserve evidence, test hypotheses economically, understand concurrency and environment effects, and choose fixes that improve future diagnosis. They communicate uncertainty honestly and protect coverage while restoring pipeline trust. They also coach the team away from sleeps, broad retries, and unowned quarantine.
How Interviewers Grade Your Answers
Interviewers usually score the structure of your reasoning before the final fix. A strong answer starts with classification, names concrete Playwright evidence, and changes one variable at a time. It distinguishes observation from inference and explains what result would disprove the hypothesis.
Use this answer pattern in live interviews:
- Scope: State whether the failure is deterministic, intermittent, local, CI-only, browser-specific, or order-dependent.
- Evidence: Name the trace view, call log, DOM snapshot, console entry, request, configuration, or metric you will inspect.
- Isolation: Describe one controlled comparison, such as one worker versus many or real response versus mocked response.
- Repair: Connect the fix to the root cause, not merely the symptom.
- Prevention: Add regression coverage, observability, ownership, or a design improvement.
Interviewers listen for sound judgment around force, retries, mocks, timeouts, and quarantine. None is universally forbidden, but each needs a narrow reason and a plan that preserves confidence. Practice explaining your decisions aloud in the QA interview practice workspace, or compare your experience against a role in the resume and job description analyzer.
Common Mistakes
- Increasing every timeout: This delays the same failure and makes feedback slower. Identify the event that never occurred or occurred too late.
- Using
waitForTimeoutas synchronization: A duration does not represent application readiness. Wait for an observable contract. - Turning on retries and declaring success: Retry recovery is evidence of nondeterminism. Preserve and investigate the first attempt.
- Using
force: truewithout proving intent: Forced interaction can bypass a real overlay, disabled state, or accessibility problem. - Debugging only from the final screenshot: Read the action log, DOM snapshots, console, and network timeline around the transition.
- Changing multiple variables together: You may get a green run without learning which change mattered. Run controlled experiments.
- Ignoring test data and cleanup: Shared accounts and fixed identifiers create order-dependent failures that resemble timing problems.
- Logging secrets into CI artifacts: Sanitize headers, bodies, cookies, and tokens before retaining diagnostic output.
- Catching errors inside helpers: Replacing the original Playwright error often removes the stack and actionability detail needed to diagnose it.
- Quarantining without ownership: A skipped test with no deadline becomes permanent lost coverage.
Conclusion
The best answers to Playwright debugging interview questions for senior QA positions combine tool knowledge with disciplined investigation. Show how you preserve first-failure evidence, classify the responsible layer, isolate one variable, and repair the underlying contract.
Before your interview, choose five scenarios from this guide and answer each in two minutes using scope, evidence, isolation, repair, and prevention. That practice demonstrates the judgment expected from a senior QA engineer more convincingly than memorizing API names.
Interview Questions and Answers
What is your first step when a Playwright test fails intermittently?
I preserve artifacts from the initial failure and reproduce with the same browser, data, workers, and environment. I classify the failure before changing the test, then compare a pass and failure at their first divergent event. I vary one factor at a time so the evidence supports causality.
How do you use Trace Viewer during debugging?
I begin at the last successful action and inspect the action log, DOM snapshots, network activity, console, and source around the failure. I compare state before and after the action rather than relying on the last screenshot. This shows whether actionability, application state, or a dependency broke first.
How do you fix a strict mode violation?
I inspect all elements resolved by the locator and identify the domain property that makes the intended element unique. I scope by a meaningful row, dialog, or region and then use role, label, text, or test id. I avoid `first()` unless ordering is explicitly part of the requirement.
Why is increasing a timeout not your default fix?
A larger timeout only helps when the correct event reliably occurs but legitimately needs more time. It cannot fix an ambiguous locator, missing event, shared-state collision, or application error. I first identify which timeout expired and which expected state failed to appear.
How do you handle a test that passes on retry?
I treat it as flaky and retain the first-attempt evidence. I compare attempts for data, cache, timing, worker, and partial side effects from the original run. Retries can protect short-term delivery, but they do not close the investigation.
How do you diagnose a CI-only Playwright failure?
I reproduce the CI command in the same image and match project settings, browser build, variables, worker count, locale, and timezone. I inspect the original job's trace before rerunning because server data can change. If it remains unreproducible, I add narrow sanitized telemetry around the leading hypothesis.
How do you debug a click on a visible element that times out?
I read the actionability log to see whether the element was stable, enabled, and receiving pointer events. I inspect the trace for overlays, animation, detachment, or duplicate elements. I fix the state or locator and use `force` only if bypassing actionability is the intended behavior.
How do you prevent shared-state failures in parallel tests?
I provision unique data for each test or worker and avoid mutable shared accounts, files, and global variables. Setup and cleanup operate only on resources owned by that test. I compare serial and parallel runs to confirm the collision and keep parallelism once isolation is repaired.
When would you quarantine a flaky test?
I quarantine only when it disproportionately blocks delivery and the product risk is understood. The test keeps running in a non-blocking lane with an owner, defect, deadline, and alternative coverage where needed. Critical-path failures may require a fix before release rather than quarantine.
What makes a debugging answer senior-level?
It identifies evidence, tests a falsifiable hypothesis, and accounts for environment, data, concurrency, and product risk. It explains both the immediate repair and the prevention mechanism. It also communicates uncertainty without hiding failures behind sleeps, broad retries, or unowned skips.
Frequently Asked Questions
How should a senior QA debug a flaky Playwright test?
Retain the first-failure trace, reproduce under the same configuration, and classify the cause as product, test, data, environment, or tooling. Compare passing and failing runs while changing one factor at a time, then add prevention after fixing the root cause.
What is the best Playwright setting for traces in CI?
`trace: 'on-first-retry'` is a practical default when retries are enabled because it limits storage while capturing a traced rerun. Use `retain-on-failure` when first-attempt trace evidence is more important than artifact cost.
Why should Playwright tests avoid waitForTimeout?
A fixed delay is disconnected from application readiness, so it wastes time on fast runs and still fails on slower ones. Wait for a specific locator state, URL, response, or web-first assertion instead.
Does passing on retry mean a Playwright test is fixed?
No. It proves the observed result was nondeterministic, and the first attempt may also have changed state for the retry. Preserve both attempts and investigate their differences.
How do you debug Playwright failures that happen only in CI?
Match the CI browser, operating system, environment, locale, timezone, headless setting, workers, shard, and application revision. Download the original trace and correlate it with resource and configuration evidence.
When should force true be used in Playwright?
Use it only when bypassing normal user actionability is explicitly part of the test intent. It should not conceal overlays, animation, disabled controls, or elements that cannot receive pointer events.
Related Guides
- Ecommerce Testing Interview Questions for Senior QA (2026)
- Agile and Scrum Interview Questions for QA Engineers (2026)
- Appium 3 Interview Questions for Senior Testers (2026)
- CI CD Troubleshooting Interview Questions for QA (2026)
- MCP Testing Interview Questions for QA Engineers (2026)
- Playwright Interview Questions and Answers for QA and SDET (2026)