Archives

Archives

Advertisements

Evaluating Gwen with Modern JavaScript Web Apps

Gwen-web was designed to take the development pain out of web automation and make it easier to achieve with all types of web applications regardless of the underlying technologies or frameworks they were built with. Our goal was to make Gwen work consistently with web pages built on any kind of server or client side framework. All web pages are just HTML documents when they hit the browser after all. But this HTML is not always static and with the recent trend of modern JavaScript framework adoption, web pages are getting more and more dynamic. A lot more things happen in web pages nowadays. Lots of JavaScript code gets loaded and all types of browser events trigger functions and Ajax requests at various times resulting in all sorts of dynamic and asynchronous rendering that makes for a very rich user experience. This might make things more pleasant for human users but it is often a hard challenge for automation programs (or robots).

The Evaluation Test

So I thought I’d try Gwen out on some web pages built on the popular and modern JS frameworks of today to see how well it performs. To do this, I wrote a feature suite that mimics these Serenity tests and ran it over the various JS implementations of the publicly available TodoMVC web application (this is a project which offers the same Todo web application implemented on different JavaScript frameworks).

It is important to note that Gwen uses the Java implementation of the Selenium web driver and is not a JS framework itself but rather a Java executable that reads plain text Gherkin features and dynamically interprets them into automated web page interactions. The evaluation performed here provides us with an indication of how well Gwen interacts with web applications built on different types of JS frameworks.

The Evaluation Results

The suite consists of 26 scenarios which I ran over 33 different JS implementations of the Todo app (for a total of 858 scenarios). I ran it in a Chrome browser on a Mac. It took about 50 minutes to run every scenario in sequence. I also ran the tests in parallel (on a dual CPU quad core machine) which took about half the time and produced consistent results. Gwen was executed with the gwen.feature.failfast setting overriden to false to force all scenarios in a feature to execute even if one or more prior ones fail.

94% of Scenarios Passed 🙂

All tests completed successfully and passed for the following frameworks.

JavaScript:

Backbone.js

AngularJS

Ember.js

KnockoutJS

Dojo

Knockback.js

CanJS

Polymer

React

Mithril

Ampersand

Vue.js

Marionette.js

Vanilla JS

Vanilla ES6

jQuery

Compile-to-JS:

Spine

Dart

GWT

TypeScript + Backbone.js

TypeScript + AngularJS

TypeScript + React

Serenade.js

Reagent

Scala.js + React

Scala.js + Binding.scala

js_of_ocaml

Humble + GopherJS

6% of Scenarios Failed

Some tests failed for the following frameworks. I have not investigated these in detail but have included my initial findings below.

JavaScript:

Flight

15 scenarios failed, 11 passed

Intermittent element hits and misses

Entered data leaks or is lost

TroopJS + RequireJS

15 scenarios failed, 11 passed

Unresponsive to enter key being sent to field

Compile-to-JS:

Closure

5 scenarios failed, 21 passed

Unresponsive to checkbox being clicked

Elm

8 scenarios failed, 18 passed

Intermittently not sending some characters to field

AngularDart

3 scenarios failed, 23 passed

Intermittently not rendering conditionally visible buttons

Conclusion

Gwen interacted successfully with a large majority of the popular JS implementations. All tests passed for 28 of the 33 implementations evaluated. More than 94% of all scenarios passed in total.

Try it Yourself

All the todoMVC features used in this evaluation are also bundled in the gwen-web distribution as of release 2.3.3. If you install the latest gwen-web distribution, you can run it by calling the following command in the directory where you install Gwen (to run in parallel mode, just add the --parallel switch):