Top Related Projects
A browser automation framework and ecosystem.
Fast, easy and reliable testing for anything that runs in a browser.
JavaScript API for Chrome and Firefox
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
Quick Overview
WebdriverIO is a progressive automation framework built to automate modern web and mobile applications. It simplifies the interaction with your app and provides a set of plugins to help you create a scalable, robust and stable test suite.
Pros
- Supports both web and mobile automation
- Easy to set up and configure
- Extensive plugin ecosystem
- Excellent documentation and community support
Cons
- Steeper learning curve for beginners compared to some alternatives
- Can be slower than other automation tools for certain operations
- Occasional stability issues with some browser/device combinations
Code Examples
- Basic browser interaction:
await browser.url('https://webdriver.io')
const title = await browser.getTitle()
console.log('Page title is: ' + title)
- Interacting with elements:
const searchInput = await $('#search_input_react')
await searchInput.setValue('WebdriverIO')
const searchButton = await $('.search-icon')
await searchButton.click()
- Waiting for elements:
const myElement = await $('#myElement')
await myElement.waitForExist({ timeout: 5000 })
await myElement.waitForDisplayed({ timeout: 3000 })
- Assertions using expect:
const element = await $('#someElement')
await expect(element).toBeExisting()
await expect(element).toHaveTextContaining('Some text')
Getting Started
- Install WebdriverIO:
npm init wdio .
- Create a test file (e.g.,
test.js
):
describe('My first test', () => {
it('should open the browser and load the page', async () => {
await browser.url('https://webdriver.io')
const title = await browser.getTitle()
await expect(browser).toHaveTitle('WebdriverIO ยท Next-gen browser and mobile automation test framework for Node.js | WebdriverIO')
})
})
- Run the test:
npx wdio run wdio.conf.js
This will execute the test using the WebdriverIO test runner with the default configuration.
Competitor Comparisons
A browser automation framework and ecosystem.
Pros of Selenium
- Wider language support (Java, Python, C#, Ruby, JavaScript)
- More established and mature ecosystem
- Extensive documentation and community resources
Cons of Selenium
- Steeper learning curve for beginners
- Slower execution compared to WebdriverIO
- More verbose code for common tasks
Code Comparison
Selenium (Java):
WebDriver driver = new ChromeDriver();
driver.get("https://www.example.com");
WebElement element = driver.findElement(By.id("myElement"));
element.click();
driver.quit();
WebdriverIO:
await browser.url('https://www.example.com');
const element = await $('#myElement');
await element.click();
await browser.deleteSession();
WebdriverIO offers a more concise and modern syntax, leveraging async/await for better readability. Selenium's code is more verbose but provides fine-grained control over browser interactions.
Both frameworks are powerful tools for web automation, with Selenium offering broader language support and a mature ecosystem, while WebdriverIO provides a more user-friendly experience for JavaScript developers with faster execution times.
Fast, easy and reliable testing for anything that runs in a browser.
Pros of Cypress
- Built-in automatic waiting and retry mechanisms, reducing flaky tests
- Intuitive debugging with time-travel and real-time reloads
- Extensive built-in assertions and commands
Cons of Cypress
- Limited cross-browser support (primarily focuses on Chrome-based browsers)
- Cannot interact with multiple browser tabs or windows
- Lacks native mobile testing capabilities
Code Comparison
Cypress example:
describe('Login', () => {
it('should log in successfully', () => {
cy.visit('/login')
cy.get('#username').type('user@example.com')
cy.get('#password').type('password123')
cy.get('button[type="submit"]').click()
cy.url().should('include', '/dashboard')
})
})
WebdriverIO example:
describe('Login', () => {
it('should log in successfully', async () => {
await browser.url('/login')
await $('#username').setValue('user@example.com')
await $('#password').setValue('password123')
await $('button[type="submit"]').click()
await expect(browser).toHaveUrlContaining('/dashboard')
})
})
Both frameworks offer powerful testing capabilities, but Cypress provides a more streamlined experience for web application testing, while WebdriverIO offers greater flexibility and broader browser support. Cypress excels in ease of use and built-in features, while WebdriverIO shines in its versatility and cross-browser testing capabilities.
JavaScript API for Chrome and Firefox
Pros of Puppeteer
- Built and maintained by Google, ensuring high-quality support and integration with Chrome
- Provides a high-level API for controlling headless Chrome or Chromium
- Excellent for web scraping and generating PDFs of web pages
Cons of Puppeteer
- Limited to Chrome/Chromium browsers, lacking cross-browser support
- Steeper learning curve for those unfamiliar with Node.js or JavaScript
Code Comparison
Puppeteer:
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
await browser.close();
WebdriverIO:
const browser = await remote({
capabilities: {browserName: 'chrome'}
});
await browser.url('https://example.com');
await browser.saveScreenshot('example.png');
await browser.deleteSession();
Both libraries offer powerful automation capabilities, but Puppeteer focuses on Chrome automation with a high-level API, while WebdriverIO provides cross-browser support and follows the WebDriver protocol. Puppeteer excels in scenarios requiring deep Chrome integration, while WebdriverIO offers more flexibility for cross-browser testing and automation.
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
Pros of Playwright
- Cross-browser support out-of-the-box (Chromium, Firefox, WebKit)
- Built-in auto-waiting mechanism for better test stability
- Powerful network interception and mocking capabilities
Cons of Playwright
- Steeper learning curve for those familiar with Selenium-based frameworks
- Limited support for older browsers and mobile testing
Code Comparison
Playwright:
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await browser.close();
})();
WebdriverIO:
const { remote } = require('webdriverio');
(async () => {
const browser = await remote({
capabilities: { browserName: 'chrome' }
});
await browser.url('https://example.com');
await browser.deleteSession();
})();
Both Playwright and WebdriverIO are powerful automation frameworks, but they differ in their approach and features. Playwright offers a more modern, browser-specific API with built-in stability features, while WebdriverIO provides a flexible, Selenium-compatible solution with extensive plugin support. The choice between them depends on specific project requirements and team preferences.
Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
Pros of Appium
- Supports multiple platforms (iOS, Android, Windows) with a single API
- Allows testing of native, hybrid, and mobile web apps
- Uses standard automation APIs for each platform, ensuring better stability
Cons of Appium
- Slower test execution compared to WebdriverIO
- More complex setup and configuration process
- Limited support for newer mobile OS features
Code Comparison
Appium (JavaScript):
const driver = await wdio.remote({
capabilities: {
platformName: "Android",
automationName: "UiAutomator2",
deviceName: "emulator-5554",
app: "/path/to/app.apk"
}
});
await driver.findElement("id", "login-button").click();
WebdriverIO:
const browser = await remote({
capabilities: { browserName: 'chrome' }
});
await browser.$('#login-button').click();
WebdriverIO focuses on web automation, offering a simpler syntax and faster execution for web-based tests. Appium provides a more comprehensive solution for mobile app testing across multiple platforms but requires more setup and has slower execution times. WebdriverIO is better suited for web automation, while Appium excels in cross-platform mobile app testing scenarios.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Next-gen browser and mobile automation test framework for Node.js.
Homepage | Developer Guide | API Reference | Contribute | Changelog | Roadmap
WebdriverIO is a test automation framework, for e2e as well as unit and component testing in the browser, that allows you to run tests based on the WebDriver and WebDriver BiDi as well as Appium automation technology. It provides support for your favorite BDD/TDD test framework and will run your tests locally or in the cloud using Sauce Labs, BrowserStack, TestingBot or LambdaTest.
:woman_technologist: :man_technologist: Contributing
Do you like WebdriverIO and want to help make it better? Awesome! Have a look into our Contributor Documentation to get started and find out what contributions can be and how to make them.
Getting started with GitHub Codespaces
To get started, create a codespace for this repository by clicking this รฐยยย
A codespace will open in a web-based version of Visual Studio Code. The dev container is fully configured with the software needed for this project.
Note: Dev containers are an open spec that is supported by GitHub Codespaces and other tools.
Getting started with Gitpod
You can also just click on:
to get a ready-to-use development environment for you to start working on this code base.
If you're looking for issues to help out with, check out the issues labeled "good first pick". You can also reach out to our Matrix Channel if you have questions on where to start contributing.
:office: WebdriverIO for Enterprise
Available as part of the Tidelift Subscription.
The maintainers of WebdriverIO and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open-source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
:package: Packages
This repository contains some of the core packages of the WebdriverIO project. There are many wonderful curated resources the WebdriverIO community has put together.
Did you build a WebdriverIO service or reporter? That's awesome! Please add it to our configuration wizard and docs (e.g. like in this example commit) as well as to our awesome-webdriverio list. Thank you! รฐยยย รขยยครฏยธย
Core
- webdriver - A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol
- webdriverio - Next-gen browser and mobile automation test framework for Node.js
- @wdio/cli - A WebdriverIO testrunner command line interface
Helper
- @wdio/config - A helper utility to parse and validate WebdriverIO options
- @wdio/logger - A helper utility for logging WebdriverIO packages
- @wdio/protocols - Utility package providing information about automation protocols
- @wdio/repl - A WDIO helper utility to provide a repl interface for WebdriverIO
- @wdio/reporter - A WebdriverIO utility to help report all events
- @wdio/runner - A WebdriverIO service that runs tests in arbitrary environments
- @wdio/utils - A WDIO helper utility to provide several utility functions used across the project
- @wdio/globals - A WDIO helper utility for importing global variables directly
Reporter
- @wdio/allure-reporter - A WebdriverIO reporter plugin to create Allure Test Reports
- @wdio/concise-reporter - A WebdriverIO reporter plugin to create concise test reports
- @wdio/dot-reporter - A WebdriverIO plugin to report in dot style
- @wdio/junit-reporter - A WebdriverIO reporter that creates test results in XML format
- @wdio/spec-reporter - A WebdriverIO plugin to report in spec style
- @wdio/sumologic-reporter - A WebdriverIO reporter that sends test results to Sumologic for data analyses
Services
- @wdio/appium-service - A WebdriverIO service to start & stop Appium Server
- @wdio/browserstack-service - A WebdriverIO service that can be used to use BrowserStack Test Observability which is a reporting, debugging, and test suite quality tracking tool for any test running anywhere. The service also helps for a better integration with the BrowserStack grid if you're running tests on the grid.
- @wdio/lighthouse-service - A WebdriverIO service that integrates Google Lighthouse commands to use it for automate tests
- @wdio/firefox-profile-service - A WebdriverIO service that lets you define your Firefox profile in your wdio.conf.js
- @wdio/sauce-service - A WebdriverIO service that provides a better integration into Sauce Labs
- @wdio/shared-store-service - A WebdriverIO service to exchange data across processes
- @wdio/testingbot-service - A WebdriverIO service that provides a better integration into TestingBot
Runner
- @wdio/local-runner - A WebdriverIO runner to run tests locally
- @wdio/browser-runner - A WebdriverIO runner to run unit or component tests in the browser
Framework Adapters
- @wdio/cucumber-framework - Adapter for Cucumber testing framework
- @wdio/jasmine-framework - Adapter for Jasmine testing framework
- @wdio/mocha-framework - Adapter for Mocha testing framework.
Others
- eslint-plugin-wdio - Eslint rules for WebdriverIO
- @wdio/smoke-test-reporter - A WebdriverIO utility to smoke test reporters for internal testing purposes
- @wdio/smoke-test-service - A WebdriverIO utility to smoke test services for internal testing purposes
- @wdio/webdriver-mock-service - A WebdriverIO service to stub all endpoints for internal testing purposes
Infrastructure Packages
These packages are not released to NPM and used to work on this codebase.
- @wdio/compiler - Esbuild script to compile the source code all of all packages
- @wdio/lerna-patch - This sub-package is being used to patch Lerna to not run
pnpm install
after it prepared all packages for release
:handshake: Project Governance
This project is maintained by awesome people following a common set of rules and treating each other with respect and appreciation.
:man_cook: :woman_cook: Backers
Become a backer and show your support for our open-source project.
:money_with_wings: Sponsors
Does your company use WebdriverIO? Ask your manager or marketing team if your company would be interested in supporting our project. Support will allow the maintainers to dedicate more time to maintenance and new features for everyone. Also, your company's logo will show on GitHub - who doesn't want a little extra exposure? Here's the info.
รฐยยย Premium Sponsor
We are immensely grateful to our exclusive Premium Sponsor for their invaluable support in the development of this project:
รฐยยฅย Gold Sponsor
รฐยยฅย Silver Sponsor
รฐยยฅย Bronze Sponsor
:page_facing_up: License
:beginner: Badge
Show the world you're using webdriver.io รขยย
GitHub markup
[](https://webdriver.io/)
HTML
<a href="https://webdriver.io/">
<img alt="WebdriverIO" src="https://img.shields.io/badge/tested%20with-webdriver.io-%23ea5906">
</a>
:clap: Supporters
Top Related Projects
A browser automation framework and ecosystem.
Fast, easy and reliable testing for anything that runs in a browser.
JavaScript API for Chrome and Firefox
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot