Protractor vs WebdriverIO vs NightWatch

JavaScript is now a popular choice of language for developing web applications. To test the applications developed in JavaScript, there seem too many ends to end testing frameworks and tools which help in Unit testing, UI testing. However, to use one of them, one has to go through and analyze each tool and framework to know which suits their application best. We, through this document, make an attempt to weigh three popular (E2E) testing tools in JavaScript.

The Approach:

We have selected three popular automation tools which can automate web applications in different browsers and in different operating systems. These are based on selenium webdriver API.

We have analyzed these automation tools in different categories to identify the advantages and disadvantages of each so that the reader of this document can choose a tool that is best suitable for their needs.
We have compared the three automation tools against different categories which we think are essential for automating a web/mobile application. Below comparison table shows which tool is good in which category.

The Comparison:
Protractor vs WebdriverIO vs NightWatch.js
CATEGORIES PROTRACTOR WEBDRIVERIO NIGHT WATCH
ARCHITECTURE Protractor is a wrapper around WebdriverJS (selenium-webdriver node module). WebdriverIO is a custom implementation of W3C webdriver JSON wire protocol. Night Watch is a custom implementation of W3C webdriver JSON wire protocol.
SUPPORTED BROWSERS Edge, Chrome, Firefox, Safari, Opera, HtmlUnit, PhantomJs Edge, Chrome, Firefox, Safari, Opera, HtmlUnit, PhantomJs Edge, Chrome, Firefox, Safari, Opera, HtmlUnit, PhantomJs
ANGULAR SPECIFIC LOCATOR STRATEGIES Supported Partially supported by adding ‘webdriverjs-angular’ node module. Only ‘WaitForAngular’ has been implemented. Not supported. But still, we should be able to automate angular js application as selenium does.
INBUILT TEST RUNNER Available Available Available
SUPPORTED TESTING FRAMEWORKS Jasmine, Mocha, Cucumber Jasmine, Mocha, Cucumber Mocha, inbuilt framework
REPORTING Junit Xml Reporter,
Protractor Html screenshot reporter, Jasmine spec reporter
Allure reporting, Jasmine Spec reporter, Junit xml reporter, Cucumber reporting Junit xml reporter,
Mocha reporting
PARALLEL EXECUTION Supported Supported Supported
CLOUD EXECUTION

  • SAUCE LABS
  • BROWSERSTACK
  • TESTING BOT
Supported Supported Supported
MOBILE SUPPORT (APPIUM) Partial support (Supports mobile browsers but does not support native apps) Android, IOS Android, IOS
SYNCHRONOUS EXECUTION Supported Supported Supported
PAGE OBJECT PATTERN Supported Supported Supported
CONTINUOUS INTEGRATION Supported Supported Supported
RETRYING FLAKY TESTS Possible Possible Possible
TYPESCRIPT SUPPORT Inbuilt support Possible when using Codecept.js Not yet supported
ADDITIONAL FEATURES Angular application support CSS regression testing using ‘webdrivercss’ npm package.
The Summary:
  • Protractor
    • Advantages
      • A protractor is the only automation tool which has inbuilt support for AngularJS element identification strategies. Better to go with protractor if the application is developed using AngularJS.
      • It has support for different unit test frameworks like (Jasmine, Mocha, Cucumber etc..)
      • Good reporting mechanism (HTML, XML etc..)
      • Compatible with Continuous integration
      • TypeScript support is available which will help Angular 2 developers to write unit tests very easily.
    • Disadvantages
      • It does not have support to automate mobile Apps.
      • It is implemented as a wrapper to the WebdriverJs. So there is one more layer added in between Selenium server and the Protractor. If there is an issue with WebdriverJs the Protractor team should wait for the WebDriverJs team to fix that issue.
  • WebDriverIO
    • Advantages
      • WebDriverIO is a custom implementation of W3C webdriver API. This gives it an edge to have full control over implementation rather than depending on WebDriverJS implementation.
      • It is fully extensible and is written to be as flexible and framework agnostic as possible. It can be applied in any context and serves not only the purpose of testing.
      • It has a command line interface ‘wdio’ which makes test configuration as easy and simple as possible so that a non-programmer can configure the setup.
      • It has support for most BDD and TDD test frameworks.
      • It has good support and enthusiastic developer community and end users which gives it an edge over NightwatchJS.
      • It can be used with ‘webdrivercss’ to compare css stylings of an element in the webpage.
    • Disadvantages
      • Since it is a custom implementation, it is also a disadvantage as it deviates from generic syntax which may confuse selenium developers coming from other languages.
      • It can be used for automating AngularJS apps but it is not as customized as Protractor.
  • NightwatchJS
    • Advantages
      • Similar to WebDriverIO, it is also a custom implementation of W3C webdriver API.
      • As all other JS libraries, it is extensible easily – one can write custom commands, assertions extending it.
      • It has its own testing framework and assertions mechanism which solves the programmer’s headache of choosing a testing framework.
    • Disadvantages
      • It does not have much of choices for unit test frameworks as it has an own testing framework and also support Mocha.
      • Slightly lesser support than WebDriverIO and Protractor.

Java Array 1-Dimensional

Array – An array is an indexed collection of a fixed number of homogeneous data elements.
1. Instead of creating multiple int, float variable, we can assign into 1 called an Array
2. Array size is fixed. If we assigned 10000 and at runtime only 2 comes then 99998 space is wasted or vice-versa. Do we must know the size in advance if we want to use an array.
3. An array can contain the only same type of data types. This problem has come over in collection concept.

Loopholes
1. At the time of array creation, we should mention the size of the array
2. It is illegal to have array size 0 in java
3. The runtime exception will come if you pass negative size array.
4. Byte, short, char, it is allowed to specify the size of the array.
5. Maximum allowed array size in Java 2147483647 which is max value of int data type

Java Primitive Data Type Part -2

Floating Data type
a. Float (Size – 4 bytes)
* Upto 6 decimal place

b. Double (Size – 8 bytes)
* Upto 14 to 15 decimal place

Boolean
* Size is not application
* Range is not application [ Allowed True/False]

char
* 2 bytes (UNICODE BASED)
* Size is char in c/c++ is 1 byte (8 bites) , 2^8 = 256 [ASCII]

Watch here:

Please give your feedback at online.nimit@gmail.com