Playwright traces can capture aria and screen snapshots
Introduced 2026-09-04 · score 0.96
HOW TO USE IT
When debugging tests with Playwright v1.63.0, configure trace snapshots to include `aria` and `screen` (and optionally `dom`) on every action. Open the trace and use Display Aria to view the action screenshot beside its aria snapshot and highlight nodes.
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
trace: {
mode: 'on',
snapshots: { dom: true, aria: true, screen: true },
},
},
});npx playwright show-trace <path-to-trace.zip>WHY THIS HELPS
Capture aria and screen state in traces to inspect UI actions during test debugging.
REQUIREMENTS AND LIMITATIONS
- Version: v1.63.0
- testOptions.trace.mode (required): Trace recording mode; `on` records and keeps a trace for every run.
- testOptions.trace.snapshots: Selects snapshots to capture on every action; may be an object or boolean.
- snapshots.dom: Captures a DOM snapshot on every action and records network activity.
- snapshots.aria: Captures an aria snapshot of the page on every action; needed for Display Aria mode.
- snapshots.screen: Captures a screenshot of the page on every action; needed for Display Aria mode.
- Display Aria mode behavior described requires aria and screen snapshots to be recorded.
FIRST-PARTY EVIDENCE
- https://github.com/microsoft/playwright/releases/tag/v1.63.0
- https://playwright.dev/docs/trace-viewer
- https://playwright.dev/docs/api/class-testoptions#test-options-trace
Check the installed version and the source before using it. Entry JSON