WebdriverIO

9.27.0 · active · verified Sun Apr 19

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.

Common errors

Warnings

Install

Imports

Quickstart

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.

import { remote } from 'webdriverio'

const browser = await remote({
    capabilities: { browserName: 'chrome' }
})

await browser.navigateTo('https://www.google.com/ncr')

const searchInput = await browser.$('#lst-ib')
await searchInput.setValue('WebdriverIO')

const searchBtn = await browser.$('input[value="Google Search"]')
await searchBtn.click()

console.log(await browser.getTitle()) // outputs "WebdriverIO - Google Search"

await browser.deleteSession()

view raw JSON →