WebDriverIO DevTools
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.
Installation
npm install @wdio/devtools-service --save-dev
Usage
Test Runner
// wdio.conf.ts
export const config = {
services: ['devtools'],
}
Standalone
import { remote } from 'webdriverio'
import { setupForDevtools } from '@wdio/devtools-service'
const browser = await remote(setupForDevtools({
capabilities: { browserName: 'chrome' }
}))
await browser.url('https://example.com')
await browser.deleteSession()
Service Options
services: [['devtools', options]]
| Option | Type | Default | Description |
|---|---|---|---|
port | number | random | Port the DevTools UI server listens on |
hostname | string | 'localhost' | Hostname the DevTools UI server binds to |
devtoolsCapabilities | Capabilities | Chrome 1600x1200 | Capabilities used to open the DevTools UI window |
screencast | ScreencastOptions | - | Session video recording (see Screencast) |
mode | 'live' | 'trace' | 'live' | live opens the DevTools UI; trace skips it and writes a portable artifact instead (see Trace Mode) |
traceFormat | 'zip' | 'ndjson-directory' | 'zip' | Trace artifact layout — single archive vs unpacked directory. Only applies when mode: 'trace' |
traceGranularity | 'session' | 'spec' | 'test' | 'session' | One trace per session / spec file / test. 'test' writes each to test-results/<spec>-<title>-<browser>[-retryN]/trace.zip. Only applies when mode: 'trace' (see Trace Mode) |
tracePolicy | 'on' | 'retain-on-failure' | 'retain-on-first-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-failure-and-retries' | 'on' | Which traces to keep. Pairs with traceGranularity: 'test'. Only applies when mode: 'trace' |
filmstrip | boolean | true | Records a dense, continuous screencast filmstrip into the trace for smooth scrubbable playback in the player — dense frames alongside the per-action frames, thinned and content-addressed at export. Only applies when mode: 'trace' |
screenshot | 'off' | 'on' | 'only-on-failure' | 'off' | Per-test screenshot, attached inline to Allure (image/png). Requires mode: 'trace' + traceGranularity: 'test' |
video | 'off' | TraceRetentionPolicy | 'off' | Per-test screencast video, retained per the given policy and attached inline to Allure (video/webm). Requires mode: 'trace' + traceGranularity: 'test' |
emitArtifactsManifest | boolean | false | Writes devtools-artifacts-<sessionId>.json — a generic index of every produced artifact plus each test's state, for reporters/CI. Auto-enabled when @wdio/allure-reporter is in the config. Only applies when mode: 'trace' |
captureAssertions | boolean | true | Capture assertions as trace action rows — node:assert plus passing/failing expect(...) matchers. Set false to opt out |