Selenium - automated functional web testing
Posted on | 27 May 2008 |
Tags: selenium | testing | tools
Last week, I set up automated functional testing for the test team using Selenium. So far, I’m thoroughly impressed with it.
Selenium comes in several version: IDE, core, remote-control, grid.
First, Selenium IDE is used to create tests and run them during test development. It comes as a Firefox plugin, which means that installation happens in one click. One of the biggest advantages of Selenium is that the tests are stored in HTML, which is easy to understand and easy to manage even without a lot of technical knowledge, making it perfect for functional testers. In addition to creating tests by recording user interactions, tests can also be manually built up from a large list of commands, implemented in Javascript. Some of these commands use XPath or DOM for specifying elements within a web page.
If the HTML/Javascript solution is not enough to expression your test scenarios, tests can be written in Java, C#, Perl, PHP, Python, or Ruby. Selenium IDE even converts an HTML script to any of the above languages for you as a starting point. But once code that cannot be converted back to HTML are introduced in the test, the test can no longer be run within the IDE, but must be compiled (if necessary) and run with Selenium RC (see below).
Second, Selenium RC (remote-control) is used for running the tests from the command line and remote from the application server, making it easy to integrate into a nightly build. Since Selenium is Java-based, it can be run in any OS that supports Java. Selenium RC encapsulates Selenium Core, which was the initial product that requires tests to be deployed together with a web app. This means that Selenium core is probably no longer used by itself.
Lastly, Selenium Grid encapsulates several Selenium RC servers and allows the tests to be run in parallel on multiple machines. This is useful to start the tests on several different OS at the same time, driven from one process.
Selenium seems to be perfect for functional testing. It is easy to adopt, but is flexible enough for more complicated test scenarios which can be written in a variety of languages.
Selenium references:
Comments
Leave a Reply