dadi zreik dadi zreik - 3 months ago 60
Java Question

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, webdriver.io. I could not find anything that could be done with webdriver.io that is not possible with webdriverjs.

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

Answer

"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.