Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
webdriverio
Advanced tools
WebdriverIO is an open-source testing utility for Node.js that allows you to control a browser or a mobile application with just a few lines of code. It is built on top of WebDriver protocol and supports both desktop browsers and mobile applications. It provides a lot of useful features to create end-to-end tests, supports synchronous and asynchronous modes, and integrates with various test frameworks like Mocha, Jasmine, and Cucumber.
Browser Automation
Automate web browsers by performing actions like navigating to URLs, clicking on elements, and retrieving page information.
const { remote } = require('webdriverio');
(async () => {
const browser = await remote({
capabilities: { browserName: 'chrome' }
});
await browser.url('https://example.com');
const title = await browser.getTitle();
console.log('Title was: ' + title);
await browser.deleteSession();
})();
Element Interaction
Interact with web elements such as input fields, buttons, and links by sending keystrokes, clicking, and retrieving attributes.
const { remote } = require('webdriverio');
(async () => {
const browser = await remote({
capabilities: { browserName: 'chrome' }
});
await browser.url('https://example.com/login');
await browser.setValue('#username', 'user123');
await browser.setValue('#password', 'pass123');
await browser.click('#submit');
await browser.deleteSession();
})();
Mobile Application Testing
Test mobile applications by launching them on simulators, emulators, or real devices and interacting with them just like with browser automation.
const { remote } = require('webdriverio');
(async () => {
const browser = await remote({
path: '/wd/hub',
capabilities: {
platformName: 'Android',
'appium:deviceName': 'emulator',
'appium:app': '/path/to/your.app'
}
});
// Your mobile testing code here
await browser.deleteSession();
})();
Integration with Test Runners
Easily integrate with test runners like Mocha, Jasmine, or Cucumber to create structured and maintainable test suites.
const { remote } = require('webdriverio');
describe('My application', () => {
it('should work with webdriverio', async () => {
const browser = await remote({
capabilities: { browserName: 'chrome' }
});
await browser.url('https://example.com');
expect(await browser.getTitle()).toBe('Expected Title');
await browser.deleteSession();
});
});
Selenium WebDriver is one of the most popular browser automation tools. It requires setting up a standalone server and writing more boilerplate code compared to WebdriverIO, which provides a more concise API and integrated test runner support.
Puppeteer is a Node library developed by the Chrome DevTools team. It provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer is typically faster and more stable for Chrome/Chromium automation because it uses the DevTools protocol, but it does not support multiple browsers out of the box like WebdriverIO does.
Cypress is a front-end testing tool built for the modern web. It is both a library for writing tests as well as a test runner. It offers a rich interactive interface for running tests but is limited to running tests within its own browser-based test runner, which can be a limitation compared to WebdriverIO's support for various browsers and mobile platforms.
Nightwatch.js is an automated testing framework for web applications and websites, written in Node.js and using the W3C WebDriver API. It is similar to WebdriverIO but has its own test runner and asserts library, which can make it easier to set up and start writing tests. However, it might not be as feature-rich as WebdriverIO in terms of community plugins and integrations.
![Gitter](https://badges.gitter.im/Join Chat.svg)
This library is a webdriver (browser automation) module for Node.JS. It makes it possible to write super easy Selenium tests in your favorite BDD/TDD test framework, that will run locally or in the cloud using Sauce Labs, BrowserStack or TestingBot.
WebdriverIO is agnostic with regards to the test framework you want to use. Cucumber, Jasmine and Mocha+Chai are supported by the configuration wizard, and you can use other frameworks as well - for example Yadda.
npm install webdriverio
or if you want to use the wdio test runner
npm install -g webdriverio
Simply run wdio config
and the configuration helper wizard will get you set up:
With all that done, have a look at the many examples.
client
.url('http://google.com')
.setValue('#q', 'webdriver')
.click('#btnG')
Notice how this is far simpler than with the original selenium-webdriverjs,
driver.get('http://www.google.com');
driver.findElement(webdriver.By.id('q')).sendKeys('webdriver');
driver.findElement(webdriver.By.id('btnG')).click();
and significantly simpler than with WD.js:
browser
.get("http://www.google.com")
.elementById('q')
.sendKeys('webdriver')
.elementById('btnG')
.click()
For more details on the comparison between WebdriverIO, selenium-webdriverjs and WD.js, read this discussion.
If you have questions or any problems using WebdriverIO join the Gitter Chat, hit us contributor on Twitter or just file an issue on Github. We will try to get back to you as soon as possible.
Also if you miss any feature, let us know so we can make WebdriverIO even better. For news or announcements check @WebdriverIO on Twitter.
The npm module for this library is maintained by:
WebdriverIO was originated by Camilo Tapia's initial Selenium project called WebdriverJS, which was the first webdriver project on NPM. In 2014, the project was renamed WebdriverIO.
MIT
FAQs
Next-gen browser and mobile automation test framework for Node.js
The npm package webdriverio receives a total of 617,683 weekly downloads. As such, webdriverio popularity was classified as popular.
We found that webdriverio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.