When comparing Selenium vs WebdriverIO, the Slant community recommends Selenium for most people. In the question“What are the best automated browser testing frameworks?” Selenium is ranked 1st while WebdriverIO is ranked 3rd. The most important reason people chose Selenium is:
The WebDriver protocol is standardized by the World Wide Web Consortium which makes it easy for third-parties to get involved and contribute to Selenium. WebDriver has been the foundation of many additional automation projects besides core selenium and has become the de-facto standard for UI automation.
Ranked in these QuestionsQuestion Ranking
Pro Uses an approved WC3 standard - WebDriver
The WebDriver protocol is standardized by the World Wide Web Consortium which makes it easy for third-parties to get involved and contribute to Selenium.
WebDriver has been the foundation of many additional automation projects besides core selenium and has become the de-facto standard for UI automation.
Pro Integrates with any CI tool
Selenium, with its ability to interact with different testing frameworks, like NUnit or xUnit, makes it easy to get Selenium working with practically any Continuous Integration services.
Supports many browsers and a solid platform for adding future browsers to selenium (WebDriver)
Pro Actively supported
The open source community behind Selenium has a very large & engaged developer base. This ensures a stable support channel for the tool. In addition, various companies also provide support for Selenium. This active and multi-channel support provides a much more lucrative option for developers looking to implement Selenium in their workflow.
Pro You can use the same IDE you use for coding to debug
Pro Integrates well with existing testing frameworks
Pro Support for many languages
Selenium is based on Java and can be run on Windows, Mac, Linux, Unix, etc.
Pro Ability to imitate a real user using the application
Testing is analogous to a human being using the web application which is not possible with a solution which runs headless and claims to run faster than Selenium.
Pro Use the very minimum amount of code required to run
Selenium tries to inject into the page only the bare minimum of code needed to run the tests.
Pro Easy to set preconditions for the tests
Pro Works with any testing framework or assertion library
WebdriverIO lets you use your favorite testing framework (Jasmine, Mocha, Cucumber) and assertion library (Chai for Mocha). Other projects implement their own testing and assertion APIs, for example Nightwatch, Intern.
It should be mentioned though that v4.2.16 has an incompatibility with at least tap v7.1.2: stdout/stderr written during a run gets lost.
Pro Used by Chimp.js
Chimp.js, is an emerging web application test framework that implements easy sync tests using WebdriverIO, CucumberJS and Chai. Features include:
- synchronous style
- built-in "widget framework" (an implementation of the PageObject pattern)
- automatically downloads dependencies (ChromeDriver, PhantomJS etc.)
- works with SauceLabs and BrowserStack (CrossBrowserTesting TBD)
- automatically takes screenshots on failures
- works on Windows in addition to Linux and OS X
- automatically produces boilerplate code for step definitions, which you can copy, paste and edit
- file watcher reuses the browser sessions and can run only the tests you tag, to maximize development speed
Pro Excellent API documentation
Pro Synchronous implementation of asynchronous browser commands
So you don't need to worry about promises
Pro Config file generation wizard
wdio config and WebdriverIO will generate a config file for testing locally vs. in the cloud, specifying the test framework (Jasmine, Cucumber, Mocha), where to find tests and store screenshots etc.
Pro Allows you to do visual regression tests using WebdriverCSS
WebdriverIO has a plugin called WebdriverCSS that allows you to do cross visual platfrom/browser tests with an integration to Applitools.
Pro Provides plugins for gulp, grunt and other
WebdriverIO is accessible via gulp and grunt and even has a Sublime Text plugin for autocompletion.
Pro Simpler syntax than selenium-webdriverjs and WD.js
driver.get('http://www.google.com'); driver.findElement(webdriver.By.id('q')).sendKeys('webdriver'); driver.findElement(webdriver.By.id('btnG')).click();
browser .get("http://www.google.com") .elementById('q') .sendKeys('webdriver') .elementById('btnG') .click()
client .url('http://google.com') .setValue('#q','webdriver') .click('#btnG')
Pro Used by Meteor's Velocity test runner
If you develop web applications with Meteor.js, you might want to use the xlovio:webdriver wrapper, because it's the Selenium binding behind the preferred testing framework (Chimp) promoted by the Velocity (Meteor's official testing framework) team for using BDD via Cucumber.
Pro Selenium Server need not be started independently
Service is provided by WebdriverIO which over comes the con of starting selenium server independently.
Con The IDE for recording isn't too powerful
Con Issues with locators
Locators that support common attributes like:
Con Must run with WDIO to debug
Tasks written in this beautiful Selenium API can only be debugged using the provided WDIO task runner. You can't set breakpoints within tasks, but you can have WDIO pause the run between Selenium commands.
Con Selenium server must be started independently
selenium-webdriverjs starts the Selenium server automatically, and actually manages to achieve a faster startup time (4 seconds vs. 5.5) than WebdriverIO.