Web Blackbox Tests done right

Most people know HtmlUnit, which is a nice way of creating Black-Box-Tests for web applications. The problem with HtmlUnit is that its JavaScript unit (namely Rhino) is not going to do, what your favorite browser will be doing. This probably leads to unit-tests that ignore the JavaScript-focused parts of the UI. Unfortunately, JavaScript based behaviour of WebPages is anywhere on today´s web-apps, so that ignoring it in your tests gets more risky ever day.

Using the user´s browser to test the UI would be the optimal solution, but the usual record&playback oriented tests have some severe drawbacks:

  • it is often not junit/testng, which makes it hard to integrate with the rest of your tests using CI etc.
  • it probably needs repetition, like always starting from a login page etc.
  • it does not use abstraction, so when you change signifcant parts of your pages, you´ll end up patching all of these tests without the help of a good IDE

This is where WebDriver comes to the rescue. If you have 30 mins to spare, take a look at its talk at GTAC.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>