Testplane Commands
Overview
This reference covers Testplane v9 and commands from its WebdriverIO v9 dependency. Availability depends on the browser, session protocol and dependency version; each page lists its requirements. For older versions, use the documentation archive and WebdriverIO v8.
Testplane does not provide the WDIO runner's implicit global browser, $ and $$. Get browser from the test argument, or use this.browser in a regular function. An arrow function does not receive the test's this context. Find elements with browser.$ and browser.$$.
Example
Both tests open / relative to baseUrl. The test page must contain an h1 with the text Command examples.
const assert = require("node:assert/strict");
it("commands: use the browser fixture", async ({ browser }) => {
await browser.url("/");
assert.equal(await browser.$("h1").getText(), "Command examples");
});
it("commands: use this.browser with a regular function", async function () {
await this.browser.url("/");
assert.equal(await this.browser.$("h1").getText(), "Command examples");
});
Choose a command
| Task | Commands |
|---|---|
| Page setup and emulation | addInitScript, emulate, restore, setViewport |
| Custom selectors | addLocatorStrategy, browser.custom$, browser.custom$$, element.custom$, element.custom$$ |
| Frames and downloads | switchFrame, downloadFile |
| Resource throttling | throttleCPU, throttleNetwork |
| Element operations | execute, executeAsync, getElement, isStable, waitForStable |
| Network interception | mock, waitForResponse, request, requestOnce, redirect, redirectOnce, reset |
| Testplane extensions | extendOptions, browser.unstable_captureDomSnapshot, element.unstable_captureDomSnapshot, unstable_getCdp |
Reference scope
Low-level WebDriver, BiDi and Appium commands are not duplicated here: see WebdriverIO protocols. Methods of InitScript and clock objects are documented with addInitScript and emulate, not as separate browser commands. When using external recipes, account for version differences and how Testplane provides browser.