Java libraries for eGov testing

As you probably know, we have focused on Selenium while developing our test suite. Selenium is great - it's supported by all common and modern browsers, has good documentation, can be used from many different languages, and it's open source too! However, Selenium is not always the right tool for the job.

Selenium is user-centric, and will only do what it believes a human could do. For example, if a link is not visible or clickable for some reason, then Selenium wont be able to visit it. This is often a good thing, but not always. This philosophy of Selenium has other consequences too; for example, Selenium cannot be used for things like HTML validation, or to check HTTP status codes, as these things are not visible to a human.

As you do Java eGov testing, you might want to check out these libraries too:
  • HttpUnit: Like Selenium, it can simulate browser requests, and provides an object model with which we can use to create our tests; for example, a WebConversation consists of several WebRequests, each of which generates a WebResponse. You can query the WebResponse object in order to access the content of the page that you have been served (such as a table)
  • Apache JMeter: Can be used within unit tests to measure the performance of your web service.
  • HtmlUnit: Similar in concept to HttpUnit, but has a significantly different implementation; while HttpUnit models the HTTP protocol and allows you to deal with request and response objects, HtmlUnit is more document-centric and allows you to deal directly with entities, such as tables
  • JWebUnit: A framework that wraps HtmlUnit and Selenium with a unified API

What else do you use to do your web testing? Please let us know in the comments!

Comments
No comments yet. Be the first.