13

Any feedback on WebdriverIO vs Selenium with Java? I am in a dilemma and wanted to clear up this confusion.

I have spent a few days learning WebdriverIO and also did some hands-on but reached the conclusion that it is not mature enough. Debugging is really a challenge.

Andrew Regan
  • 4,887
  • 6
  • 35
  • 67
user3559569
  • 199
  • 2
  • 2
  • 7
  • The conclusion - webdriverIO is not as mature as Selenium, does it still hold true, is it still relevant? Is there anything that Selenium can do and webdriverIO can't? – Anjani Kumar Oct 06 '20 at 07:50

2 Answers2

16

WebdriverIO is a JavaScript / nodejs implementation of the (Selenium 2.0) WebDriver API - one of many (Selendroid, Protractor, etc.) As the specification says:

WebDriver is a remote control interface that enables introspection and control of user agents. It provides a platform- and language-neutral wire protocol as a way for out-of-process programs to remotely instruct the behaviour of web browsers.

If you use Java, you'll use the Java implementation of WebDriver. Which language, and which implementation you choose, is up to you, your skills, and the skill of your team.

Though I very much doubt that WebdriverIO is "not mature enough". WebDriver is a fine spec, with a number of powerful implementations, but it is very frequently misused. Certainly as far as newbies go, a very large proportion of "random" failures are completely avoidable race conditions within their test code.

Andrew Regan
  • 4,887
  • 6
  • 35
  • 67
  • thanks Andrew.. I didn't understand your last point which says - a very large proportion of "random" failures are completely avoidable race conditions within their test code. – user3559569 Feb 26 '16 at 03:12
  • 1
    If we choose WebdriverIO(A javascript approach)..how would be able to debug the code. If any error occur , we need to look into feature file , steps file , json etc...(just to find that mistake due to which browser is not opening.) – user3559569 Feb 26 '16 at 03:16
  • 3
    @user3559569 Believe me when I say that I understand your frustration. I started out with Java Selenium myself. What Andrew is referring to about race conditions is that Javascript uses callbacks and promises. WebdriverIO is an amazing tool and actually includes extensive debugging and logging tools. I'd start by setting the logLevel in wdio.conf.js. Also, WebdriverIO has a debug command you can use to pause execution of your code and inspect the browser * http://webdriver.io/api/utility/debug.html – jrader Feb 26 '16 at 17:06
  • 1
    @user3559569 I found these links very helpful in switching from Java Selenium to WebdriverIO : * http://peter.michaux.ca/articles/transitioning-from-java-classes-to-javascript-prototypes * http://code.tutsplus.com/tutorials/an-introduction-to-webdriver-using-the-javascript-bindings--cms-21855 – jrader Feb 26 '16 at 17:07
  • Thanks a ton jrader...but webdriver.io itself doesn't have full documentation.If you see...most of the appium API are not full documented.Secondly , as far as debugging is concern , we are working in team where we have offshore and onshore mode....if offshore left and onshore continue with the work and vice versa...sometime small small syntax error which IDE itself doesn't detect - won't allow browser to be launched. – user3559569 Feb 26 '16 at 18:02
  • one more point to discuss...Would webdriver.io be the the good option for a big project end to end testing. – user3559569 Feb 26 '16 at 18:11
  • @user3559569 I can't speak for the Appium commands as I have never used those. Can you explain what you mean when you say "sometime small small syntax error which IDE itself doesn't detect - won't allow browser to be launched."? And when you ask if WebdriverIO is a good option for end to end testing...that really depends on your application and/or whether or not you are using PhantomJS. I have been using Webdriverio for E2E and it works beautifully. However, I would not suggest to use it with PhantomJS since it uses Ghostdriver as a bridge. Ghostdriver is not maintained at the moment – jrader Mar 14 '16 at 20:40
  • @user3559569 Also, I know that current documentation for WebdriverIO is behind the times. I've been using version 3.1.0 which works just fine for me – jrader Mar 14 '16 at 20:41
  • As webdriver.io, appium, selenium documentation are constantly undergoing upgrades, so could we get update to reflect it. Thanks – user2451016 Jan 25 '19 at 11:52
5

So we are using a Java - Selenium, Serenity, JBehave test framework and then the Javascript WebdriverIO, Mocha, and Yodda.

I think the Java approach is easier to understand and debug. Easier to understand because website testing is mostly sequential, you navigate from one page to another, click on a button, and fill out a form. It saves you from any async issues you run into using the JS alternative. Debugging is very nice because you have classes and a fixed structure to everything.

The second project uses NodeJS in the backend so integrating the testing framework was alot easier. The testing framework became part of the deployment/development process.

Marek
  • 301
  • 2
  • 5