Difference between webdriverjs and webdriverio

ぐ巨炮叔叔 提交于 2021-02-05 13:11:18

问题


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.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/27174083/difference-between-webdriverjs-and-webdriverio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!