WebdriverIO is a next-generation Node.js-based test automation framework for web browsers and mobile applications. It provides a comprehensive API built on top of the WebDriver and Appium protocols, allowing for robust end-to-end testing. The current stable version is 9.27.0, with releases occurring frequently, often multiple times a month, indicating active development and quick bug fixes. Key differentiators include its flexibility to run tests locally with WebDriver or remotely with cloud providers like Sauce Labs, built-in support for Puppeteer for browser automation, and its modular architecture allowing integration with various services and reporters. It offers a standalone API for custom scripts and a powerful test runner via `@wdio/cli` for structured test suites, supporting popular frameworks like Mocha, Jasmine, and Cucumber.
npm install webdriverioVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize a standalone WebdriverIO browser instance, navigate to a page, interact with elements, and retrieve the page title using Puppeteer capabilities for Chrome.
Review the WebdriverIO v9 changelog and Appium 3 migration guide. Update any deprecated Appium protocol command names in your test suite to their new equivalents.
Update all instances of `multiremotebrowser` in your configuration files and test scripts to `multiRemoteBrowser`.
Ensure your project is using TypeScript 7 or a later compatible version to avoid potential type inference or compilation problems.
If encountering issues with named imports in CommonJS files, particularly after previous updates, verify your CJS import patterns or consider migrating to ESM for improved compatibility.
If using Appium 3, review your mobile command arguments, especially for actions like 'touch' or 'swipe', as their signatures might have changed. Consult the Appium 3 and WebdriverIO v9 documentation for updated argument structures.
Upgrade your Node.js installation to version 18.20.0 or higher. Use a Node Version Manager (like `nvm`) to easily switch and manage Node.js versions.
For standalone scripts, ensure you use `import { remote } from 'webdriverio'` at the top. If working within the `@wdio/cli` test runner, the `browser` object is automatically globally available and does not need explicit import or initialization via `remote`.Verify the selector is correct and unique for the desired element. Use explicit waits (e.g., `browser.waitUntil` or `element.waitForExist`) to ensure the element is available and interactable before attempting to use it.
In standalone scripts (not run by `@wdio/cli`), you must explicitly create the browser instance: `const browser = await remote({ capabilities: { browserName: 'chrome' } })`. The global `browser` object is only injected by the WebdriverIO test runner.