Start Playwright UI Mode from your project with npx playwright test --ui. It lets you choose tests, watch them rerun as you edit, and inspect a run’s timeline, snapshots, actions, logs, and errors. Use it for interactive local development; use --debug when you want Playwright Inspector’s step-through workflow, and configure trace capture separately for CI.
Launch UI Mode
Open a terminal at the root of a project configured for Playwright Test and run:
npx playwright test --ui
The command opens Playwright’s interactive UI. Its test-file sidebar lets you run the full suite or select an individual file, describe block, or test. The official guide recommends UI Mode for walking through test steps and seeing what happened before, during, and after each step: Running and debugging tests.
Select tests and narrow the list
Use the sidebar to choose what to run. When the project has many tests, narrow the displayed tests with the available text, @tag, project, and passed, failed, or skipped status filters. Filtering helps you focus on relevant tests; it does not change what the test itself asserts.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
If tests depend on project setup tasks, run those setup tests first. UI Mode does not automatically take setup tests into account, according to the UI Mode guide. If a test fails because an expected login, seeded data, or other prerequisite is missing, check the setup project and run its setup test before retrying the dependent test.
Watch tests while editing
UI Mode supports watch mode: after you change a test, Playwright can rerun it so you can check the result in the same interactive workflow. This is useful when refining a test or investigating a failure. Keep the selected tests focused while iterating; run the broader suite when you need to check that the change has not affected other tests.
Rank #2
Read a run’s timeline and failure details
Choose a test run and follow its timeline to connect browser activity with the test’s actions. Hover over timeline actions to view page snapshots from those moments.
- Actions: inspect the locator used, action duration, and DOM changes. Compare the Before and After states to see whether the page changed as expected.
- Logs and network: filter messages to the selected timeline range to focus on what happened around an action.
- Errors: read the test error and use its timeline marker to locate where the failure occurred.
This sequence is often more useful than looking only at the final failure message: identify the failing action, inspect the page state before and after it, then check nearby logs or network messages for context. The UI and trace details are documented in the UI Mode guide.
Rank #3
Use Pick locator carefully
Use Pick locator to select an element from the DOM snapshot. The locator playground shows the proposed locator, where you can refine and copy it into the test. The locator picker can also highlight matching elements as you inspect the page; see the running and debugging guide.
Review a generated locator in the context of the test instead of treating it as proof that the locator expresses the intended behavior. Prefer a locator that identifies the element by the role, label, text, or other meaningful property your test is meant to verify, and check that it targets the right element when similar elements appear on the page.
Rank #4
- Used Book in Good Condition
Choose UI Mode, Inspector, headed execution, or CI traces
| Workflow | Best fit | What it gives you |
|---|---|---|
npx playwright test --ui |
Interactive local development and exploration | Test selection, filters, watch mode, and trace-based review with timeline and snapshots. |
npx playwright test --debug |
Step-through debugging | Launches the separate Playwright Inspector workflow with a browser and Inspector. The CLI documents defaults including headed mode, one worker, and no test timeout. See Playwright CLI and Debugging tests. |
npx playwright test --headed |
Seeing the browser during execution | Runs with a visible browser; it is a visibility option, not the interactive UI Mode. See Running and debugging tests and Playwright CLI. |
| Trace capture in CI | Reviewing failures or retries outside an interactive local session | Lets you inspect traces in Trace Viewer or the HTML report. Playwright cautions that recording traces for every test is performance heavy; documented alternatives include on-first-retry and retain-on-failure. See Trace Viewer and Test options. |
These workflows are related but not interchangeable: choose UI Mode to explore and review, Inspector to step through debugging, headed execution when browser visibility is enough, and CI trace settings when you need artifacts from automated runs.
Use UI Mode in Docker or Codespaces safely
For a container environment where the UI needs to be reachable from outside the container, the official guide shows these options:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteBest Value
npx playwright test --ui-host=0.0.0.0
npx playwright test --ui-port=8080
--ui-host=0.0.0.0 binds the endpoint so it can be reached from other machines on the network. Playwright warns that this can also make UI Mode, traces, passwords, and secrets accessible to those machines. Use that binding only in a trusted, controlled environment; do not expose it as a casual convenience. --ui-port=8080 selects a fixed port when useful. See the UI Mode guide.
Troubleshoot common problems
- A dependent test fails because its setup did not run: run the relevant setup test first. UI Mode does not automatically account for setup tests.
- The test list is too broad: apply text,
@tag, project, or status filters, then select the specific test or group you need. - An action fails but the cause is unclear: inspect its timeline entry, locator, duration, and Before/After snapshots; then filter logs and network messages to that time range and check the Errors tab.
- A suggested locator seems wrong or fragile: refine it in the locator playground and verify it identifies the intended element in the test’s actual context.
- The UI is unreachable from another machine in a container: check whether the UI needs an externally reachable host and whether you intentionally bound it to
0.0.0.0. Do not broaden network access unless the environment is trusted and controlled. - CI runs are slowed by trace collection: avoid recording traces on every test unless you need that coverage. Consider the documented
on-first-retryorretain-on-failurepolicies instead.
Or skip the browser setup
If you need a screenshot of a URL rather than an interactive Playwright test session, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. It accepts cookie or consent banners before capture and removes known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers.
For example, using cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




