Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Wait for the screen to stabilize after interactions
.claude/skills/testdriverai-testdriver-redraw/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 67% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 57% | 0% |
<!-- Generated from redraw.mdx. DO NOT EDIT. -->
The redraw system waits for the screen to stabilize after an interaction before continuing. It detects when animations, page loads, and network requests have settled, preventing actions from being performed on a changing screen.
<Note> Redraw is disabled by default since v7.3. Enable it explicitly if your tests interact with applications that have significant animations or loading states. </Note>
Redraw uses a two-phase detection approach:
The screen is considered settled when both phases complete: the screen changed from the initial state AND consecutive frames are now stable.
mermaidflowchart TD A[Action performed] --> B{Phase 1: Change Detection\ndiffFromInitial > 0.1%?} B -- "Yes (screen changed)" --> C{Phase 2: Stability\nz-score < 0 or\ndiffPercent < 0.1%?} C -- "Yes (frames stable)" --> D[Screen settled ✓] B -- "No (waiting...)" --> B C -- "No (waiting...)" --> C
The system polls at 500ms intervals, comparing screenshot frames. This reduces WebSocket traffic while still providing responsive detection.
Uses pixelmatch for per-pixel comparison with a threshold of 0.1 for pixel sensitivity. A frame diff above 0.1% of total pixels indicates the screen has changed.
Screen stability uses statistical analysis of the last 10 measurements:
(currentDiff - mean) / stddevdiffPercent < 0.1% or z-score < 0 (current diff is below the average)This approach adapts to the specific animation patterns of your application rather than using a fixed threshold.
Each command type has a specific redraw timeout:
| Command | Timeout | Reason | |---------|---------|--------| | click | 5000ms | Page navigations, modal openings | | hover (within click) | 5000ms | Same as click | | hover (standalone) | 2500ms | Tooltip animations | | scroll | 5000ms | Lazy-loaded content | | type | 5000ms | Autocomplete, validation | | pressKeys | 5000ms | Keyboard shortcuts may trigger changes | | focusApplication | 1000ms | Window focus animations |
If the timeout is reached before the screen settles, the command continues anyway. The timeout event is available via the redraw:complete event.
javascriptconst testdriver = new TestDriver({ // Shorthand: enable/disable redraw: true, // enable with defaults redraw: false, // disable (default since v7.3) // Full configuration redraw: { enabled: true, screenRedraw: true, // enable screen pixel diff detection networkMonitor: false, // enable network settling detection }, });
<ParamField path="redraw" type="RedrawConfig | boolean" default={false}> Redraw configuration. Pass true/false for shorthand, or an object for fine-grained control.
<Expandable title="properties"> <ParamField path="enabled" type="boolean" default={false}> Enable or disable the redraw system. Default changed to false in v7.3. </ParamField>
<ParamField path="screenRedraw" type="boolean" default={true}> Enable pixel-diff-based screen change detection. If both screenRedraw and networkMonitor are false, redraw auto-disables. </ParamField>
<ParamField path="networkMonitor" type="boolean" default={false}> Enable network traffic monitoring for settling detection. Monitors WebSocket traffic on the sandbox to detect when network activity subsides. </ParamField> </Expandable> </ParamField>
Override redraw settings for individual commands:
javascript// Enable redraw for a specific click await testdriver.find('load more').click({ redraw: { enabled: true }, }); // Disable redraw for a fast interaction await testdriver.find('checkbox').click({ redraw: false, });
When networkMonitor is enabled, the system also monitors sandbox network traffic:
totalBytesReceived and totalBytesSent from the sandboxThe final settling condition requires both screen AND network to be settled (when both are enabled).
The redraw system emits events through the SDK emitter. See Events for the full event reference.
| Event | Description | |---|---| | redraw:status | Emitted on each poll with current screen diff, network stats, and timeout info | | redraw:complete | Emitted when redraw resolves (settled or timed out) |
javascripttestdriver.emitter.on('redraw:status', (status) => { console.log(`Screen: ${status.redraw.text}`); console.log(`Network: ${status.network.text}`); console.log(`Timeout: ${status.timeout.text}`); }); testdriver.emitter.on('redraw:complete', (result) => { if (result.isTimeout) { console.warn(`Redraw timed out after ${result.timeElapsed}ms`); } else { console.log(`Screen settled in ${result.timeElapsed}ms`); } });
Enable redraw when:
Keep redraw disabled when:
typescriptinterface RedrawConfig { enabled?: boolean; // Default: false (since v7.3) screenRedraw?: boolean; // Default: true networkMonitor?: boolean; // Default: false } interface RedrawStatusEvent { redraw: { enabled: boolean; settled: boolean; hasChangedFromInitial: boolean; consecutiveFramesStable: number; diffFromInitial: number; diffFromLast: number; text: string; }; network: { enabled: boolean; settled: boolean; rxBytes: number; txBytes: number; text: string; }; timeout: { isTimeout: boolean; elapsed: number; max: number; text: string; }; } interface RedrawCompleteEvent { screenSettled: boolean; hasChangedFromInitial: boolean; consecutiveFramesStable: number; networkSettled: boolean; isTimeout: boolean; timeElapsed: number; }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,662 | 5,288 | -61% | 1 | 1 | 0% | 2,275 | 2,491 | +9% | 0 | 0 | — |
case-02 | fail→fail | 12,851 | 9,892 | -23% | 1 | 1 | 0% | 2,264 | 3,809 | +68% | 0 | 0 | — |
case-03 | fail→pass | 13,251 | 8,437 | -36% | 1 | 1 | 0% | 2,012 | 3,365 | +67% | 0 | 0 | — |
case-04 | pass→fail | 14,379 | 12,729 | -11% | 1 | 1 | 0% | 2,203 | 3,936 | +79% | 0 | 0 | — |
case-05 | fail→fail | 11,740 | 8,963 | -24% | 1 | 1 | 0% | 1,693 | 3,249 | +92% | 0 | 0 | — |
case-06 | fail→pass | 10,763 | 6,650 | -38% | 1 | 1 | 0% | 1,886 | 3,049 | +62% | 0 | 0 | — |
case-07 | pass→pass | 4,538 | 1,249 | -72% | 1 | 1 | 0% | 749 | 2,070 | +176% | 0 | 0 | — |
case-08 | fail→pass | 11,655 | 6,314 | -46% | 1 | 1 | 0% | 1,853 | 3,082 | +66% | 0 | 0 | — |
case-09 | fail→fail | 11,445 | 1,933 | -83% | 1 | 1 | 0% | 1,874 | 2,182 | +16% | 0 | 0 | — |
case-10 | pass→pass | 17,758 | 1,737 | -90% | 1 | 1 | 0% | 1,346 | 2,122 | +58% | 0 | 0 | — |
case-11 | pass→pass | 8,750 | 1,557 | -82% | 1 | 1 | 0% | 1,454 | 2,114 | +45% | 0 | 0 | — |
case-12 | fail→pass | 9,663 | 1,760 | -82% | 1 | 1 | 0% | 1,379 | 2,167 | +57% | 0 | 0 | — |
case-13 | fail→pass | 9,634 | 1,452 | -85% | 1 | 1 | 0% | 1,340 | 2,054 | +53% | 0 | 0 | — |
case-14 | fail→pass | 10,279 | 1,597 | -84% | 1 | 1 | 0% | 1,403 | 2,123 | +51% | 0 | 0 | — |
case-15 | fail→pass | 9,183 | 2,430 | -74% | 1 | 1 | 0% | 1,384 | 2,242 | +62% | 0 | 0 | — |
case-16 | fail→pass | 9,621 | 2,979 | -69% | 1 | 1 | 0% | 1,351 | 2,235 | +65% | 0 | 0 | — |
case-17 | fail→pass | 12,226 | 3,123 | -74% | 1 | 1 | 0% | 1,599 | 2,327 | +46% | 0 | 0 | — |
case-18 | fail→pass | 7,024 | 3,622 | -48% | 1 | 1 | 0% | 1,187 | 2,329 | +96% | 0 | 0 | — |
case-19 | fail→pass | 9,145 | 3,777 | -59% | 1 | 1 | 0% | 1,505 | 2,402 | +60% | 0 | 0 | — |
case-20 | fail→pass | 17,354 | 3,930 | -77% | 1 | 1 | 0% | 2,690 | 2,623 | -2% | 0 | 0 | — |
case-21 | fail→pass | 16,366 | 3,834 | -77% | 1 | 1 | 0% | 2,252 | 2,432 | +8% | 0 | 0 | — |
case-22 | fail→pass | 14,182 | 3,650 | -74% | 1 | 1 | 0% | 2,041 | 2,431 | +19% | 0 | 0 | — |
case-23 | fail→pass | 15,785 | 14,064 | -11% | 1 | 1 | 0% | 2,366 | 4,142 | +75% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +65 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
The publisher has shipped newer versions since this run, so these numbers describe v1, not the version currently listed.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.