Thursday, September 17, 2009

An Introduction to Tellurium For Web Testing

We've written several articles on using Selenium for web testing and have enjoyed using the frameworks that support Selenium. This has included taking our Selenium work to the cloud with SauceRC (Using SauceRC To Run Automated Cross-Browser Tests In The Cloud). Recently, we've been talking to some developers that use the Tellurium framework and we are very impressed with what we've seen so far. And, since it uses Selenium to drive the browser, we can easily build upon this experience to take advantage of what Tellurium offers.

Having said this, there's a big difference between using the Selenium IDE to generate scripts and using the Tellurium framework.  To start with,  Tellurium does not use "record and replay." Instead, you use the Tellurium Firefox plugin TrUMP to generate something called a UI module. Then you need to create your test code based on the UI module. The benefit here is that the UI and the test code are decoupled. This gives you structured test code. For those of you that are familiar with and use the Selenium IDE, this diagram will help you understand the difference between the "record and replay" aspect of the Selenium IDE and using the Tellurium framework:

The main benefit I can see for this framework is that you can remove the dependency of UI objects from external UI elements (i.e. external UI changes will not affect the current UI module for most cases). This is very promising but remains to be seen how much dependency is removed. This would be very helpful in lowering the cost of maintaining your code.

The main benefits of using Tellurium, as listed at the main web site, are:
  • JavaScript Events: JavaScript is everywhere on the web today. Many web applications are JavaScript heavy. To test JavaScript, the automated testing framework should be able to trigger JavaScript events in a very convenient way.
  • Ajax for Dynamic Web Content: Web applications have many benefits over desktop applications; for example they have no installation and application updates are instantaneous and easier to support. Ajax is a convenient way to update a part of the web page without refreshing the whole page. AJAX makes web applications richer and more user-friendly. The web context for an Ajax application is usually dynamic. For example, in a data grid, the data and number of rows keep changing at runtime.
  • Robust/Responsive to Changes: A good automated web testing tool should be able to address the changes in the web context to some degree so that users do not need to keep updating the test code.
  • Easy to Maintain: In an agile world, software development is based on iterations, and new features are added on in each sprint. The functional tests or user acceptance tests must be refactored and updated for the new features. The testing framework should provide the flexibility for users to maintain the test code very easily.
  • Re-usability: Many web applications use the same UI module for different parts of the application. The adoption of JavaScript frameworks such as Dojo and ExtJS increases the chance of using the same UI module for different web applications. A good testing framework should also be able to provide the re-usability of test modules.
  • Expressiveness: The testing framework should be able to provide users without much coding experience the ability to easily write test code or scripts in a familiar way, like by using a domain specific language (DSL).
There's a lot more to learn about Tellurium and you can find it all at this link.  And if you'd like to read about the experiences of a tester that had a very positive experience in his first Tellurium project, take a look at this article:  Browser based testing - a QA perspective. The author of this article writes about a compelling problem for all testers - How do you effectively test a Website that is constantly changing?

0 comments. Add Comment.: