You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DevTools is a UI test runner for WebdriverIO. It provides a user interface for running, debugging, and inspecting your browser automation tests, along with advanced features like network interception, performance tracing, and more.
4
+
A WebdriverIO service that provides a developer tools UI for running, debugging, and inspecting browser automation tests. Features include DOM mutation replay, per-command screenshots, network request inspection, console log capture, and session screencast recording.
|`port`|`number`| random | Port the DevTools UI server listens on |
47
+
|`hostname`|`string`|`'localhost'`| Hostname the DevTools UI server binds to |
48
+
|`devtoolsCapabilities`|`Capabilities`| Chrome 1600×1200 | Capabilities used to open the DevTools UI window |
49
+
|`screencast`|`ScreencastOptions`| — | Session video recording (see below) |
50
+
51
+
## Screencast Recording
52
+
53
+
Records browser sessions as `.webm` videos using the Chrome DevTools Protocol. Videos are displayed in the DevTools UI alongside the snapshot and DOM mutation views.
54
+
55
+
### Setup
56
+
57
+
Screencast encoding requires **ffmpeg** on `PATH` and the `fluent-ffmpeg` package:
|`captureFormat`|`'jpeg' \| 'png'`|`'jpeg'`| Frame image format. **Chrome/Chromium only** — controls the format Chrome sends over CDP. Ignored in polling mode (Firefox, Safari) where screenshots are always PNG. Does not affect the output video container, which is always `.webm`|
93
+
|`quality`|`number`|`70`| JPEG compression quality 0–100. Only applies in Chrome/Chromium CDP mode with `captureFormat: 'jpeg'`|
94
+
|`maxWidth`|`number`|`1280`| Maximum frame width in pixels. **Chrome/Chromium only** — Chrome scales frames before sending over CDP. Ignored in polling mode |
95
+
|`maxHeight`|`number`|`720`| Maximum frame height in pixels. **Chrome/Chromium only** — same as above |
96
+
|`pollIntervalMs`|`number`|`200`| Screenshot interval in milliseconds for non-Chrome browsers (polling mode). Lower = smoother video but more WebDriver round-trips during test execution |
97
+
98
+
### Browser support
99
+
100
+
Recording works across all major browsers using automatic mode selection:
101
+
102
+
| Browser | Mode | Notes |
103
+
|---|---|---|
104
+
| Chrome / Chromium / Edge |**CDP push**| Chrome pushes frames over the DevTools Protocol. Efficient — no impact on test command timing |
105
+
| Firefox / Safari / others |**BiDi polling**| Falls back to calling `browser.takeScreenshot()` at `pollIntervalMs` intervals. Works wherever WebDriver screenshots are supported; adds a small overhead proportional to the interval |
106
+
107
+
No configuration change is needed to switch modes — the service detects browser capabilities automatically and logs which mode is active.
108
+
109
+
### Behaviour
110
+
111
+
- Recording starts when the browser session opens and stops when it closes.
112
+
- Leading blank frames (captured before the first URL navigation) are automatically trimmed so videos begin at the first meaningful page action.
113
+
- If `browser.reloadSession()` is called mid-run, the service finalises the current recording and starts a fresh one for the new session. Each session produces its own `.webm` file.
114
+
- When multiple recordings exist, the DevTools UI shows a **Recording N** dropdown to switch between them.
115
+
- Output files are written to the directory containing `wdio.conf.ts` (WDIO's `rootDir`) or `outputDir` if explicitly configured.
116
+
117
+
### Output files
118
+
119
+
| File | Description |
120
+
|---|---|
121
+
|`wdio-trace-{sessionId}.json`| Full trace: DOM mutations, commands, screenshots, console logs, network requests |
122
+
|`wdio-video-{sessionId}.webm`| Screencast video (only produced when `screencast.enabled: true`) |
0 commit comments