Selenium is a web testing framework. You can break it up into 3 parts:
1. The web site being tested
2. A client that you write (in Java or C#, for example), that exercises the web site and makes assertions in a framework like JUnit or NUnit
3. A Selenium server, written in Java, that acts as a proxy for your client, forks browsers (e.g. FireFox and IE) and then mediates between your client and your web site. Part of the power of Selenium is that it uses your actual browser, so you get close to an accurate testing environment.
The problem with web testing in general is that it is very sensitive to changes in the site being tested. Change the xpath of a control and your test will have to be rewritten.
This solution took only 2 days to implement and negates the need for someone to rewrite the tests every day in a language like C#. Just re-record, translate and debug and you’re done. Developers can do it themselves for features that they come up with, and QA can add tests of their own.
The process:
1. You use FireFox and the Selenium IDE plugin for FireFox to record a test in “HtmlSelenese” (the default save format for the plugin). Note that it is recorded in FireFox, but tested in any browser Selenium supports.
2. You automatically translate that test into Java or C# or whatever, making sure that your translator accommodates idiosyncracies in your UI or Selenium, or both. Most of the problems stem from JavaScript/Ajax, and result in the IDE giving you a wrong xpath for an element or a bad semantics for your application, e.g. when a div exists but is not visible.
3. You subclass DefaultSelenium in Java/C# to accommodate your translator. For example, you might want to override “IsVisible” to include testing for the presence of the element in a loop — Selenium will throw an error if you test before the page is fully loaded, which can happen with Ajax applications.
So what you are doing here is using one-off development time to replace everyday QA time. You will need to update the translator much less often than the tests that it translates.
The methodology:
Selenium is written in Java. You can modify the XlateHtmlSeleneseToJava class to produce a translator that translates to anything. Just remember to add the ideoc.xml that this class needs.
The payoff:
Your QA people can come up with a methodology for recording tests, and then rerun the Selenium IDE to record this test, and translate the test automatically to your testing framework’s language, in minutes. No fiddling around with rewriting Java or C# tests every time the web site changes.
Agile, that is.