Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between webdriverjs and webdriverio

I am trying to choose a tool for Javascript automation tests.

Until now I used Selenium WebDriver in Java with TestNG to build my tests, but I have been asked to search for JavaScript solution to write tests.

Of course the first thing on my mind was to move to WebDriverJs - it should be similar to my Java tests.

But, I also found another framework: WebdriverIO. I could not find anything that could be done with WebdriverIO that is not possible with WebDriverJs.

Please help me to understand the difference so I can choose the right framework for me.

like image 610
dadi zreik Avatar asked Nov 27 '14 15:11

dadi zreik


People also ask

What is difference between WebDriver and WebdriverIO?

WebdriverIO Vs Selenium WebDriver Both WebdriverIO and Selenium WebDriver are open source and are used for browser testing. Selenium is used for automating browsers, while WebdriverIO is used for automating both browsers and native mobile apps.

What is WebDriverJS?

So as you might guess, WebDriverJS is simply a wrapper over the JSON wire protocol exposing high level functions to make our life easy. Now if you search webdriver JS on the web, you'll come across 2 different bindings namely selenium-webdriver and webdriverjs (yeah, lots of driver), both available as node modules.

Is WebdriverIO part of Selenium?

WebdriverIO is the next-gen WebDriver test framework for Node. js made upon Selenium. Set of frameworks originating from SUnit (Smalltalk's testing framework).


2 Answers

"WebdriverJS" is another name for selenium-webdriver, the official Node.JS implementation of the JSONWire (WebDriver Wire) Protocol by the Selenium team.

"WebdriverIO" is an independent implementation of the JSON Wire Protocol by Christian Bromann (SO profile), who works at Sauce Labs, a provider of cloud-base cross-browser testing. WebdriverIO wraps its lower level requests into useful commands, with a concise syntax:

client
    .url('http://google.com')
    .setValue('#q','webdriver')
    .click('#btnG')

The same test with selenium-webdriver is more complicated:

driver.get('http://www.google.com');
driver.findElement(webdriver.By.id('q')).sendKeys('webdriver');
driver.findElement(webdriver.By.id('btnG')).click();

There are at least seven Webdriver clients written in Node.JS.

like image 190
Dan Dascalescu Avatar answered Oct 22 '22 06:10

Dan Dascalescu


WebdriverJS is actually what WebdriverIO packs along with a test runner in a node package format. There isn't really anything that can't be done with WebdriverJS that WebdriverIO will do. You can use WebdriverJS along with Jasmine or Mocha as well.

Of course, the wrappers in WebdriverJS and WebdriverIO are differently labelled but that does not change the way they implement Webdriver WIRE protocol.

If you are into testing AngularJS based apps, there's a even more streamlined implementation of WebDriver WIRE protocol in Protractor (which is again distributed as a node package).

like image 2
Prashant Sinha Avatar answered Oct 22 '22 06:10

Prashant Sinha