PushToTest,
the open source application performance management and load test
solution company, participates in the Selenium project. Many times
PushToTest's response to a customer issue is in the form of an
improvement to Selenium itself. The following questions and answers
originally appeared in DZone.
What
exactly is Selenium?
Selenium is a combination of tools and a domain specific language (DSL)
to build and operate functional, smoke tests, and integration tests of
Web applications, including Rich Internet Applications (RIA, using
Ajax.) Selenium provides a record/playback tool that plugs-into the
Firefox browser. The recordings use the Selenese DSL to express the
steps of a test. Selenium plays-back the test steps in the browser
using a Javascript-based Browserbot daemon. Selenium Remote Control
(RC) runs the test in Internet Explorer, Firefox, Opera, Safari, Chrome
and other browsers. Selenium Grid makes it easy to run these tests in a
grid of test machines.
How
long has the project been around? And how long have you been using it?
Selenium had its start at ThoughtWorks,
a system integrator and global consulting firm. The core developers
released Selenium into an open source distribution in 2006. PushToTest
began using Selenium since 2007. PushToTest was looking for a way to
repurpose Selenium tests as load and performance tests, and business
service monitors when Olivier Dony and Dominique de Waleffe contributed
a TestMaker package to run Selenium tests using the HtmlUnit headless
high performance browser. PushToTest enhanced this work to
make the Selenium tests data-driven, to provide root cause analysis and
results analysis functions, to provide compatibility to test Ajax
applications, and to run these tests in a Cloud testing Environment.
This has been hugely beneficial to organizations needing to reduce
costs and take advantage of Selenium's easy-of-test-authoring features.
What
are the basic steps involved in getting setup with Selenium?
(jars/server setup etc)
Setup to record and playback tests of Web browser-based applications
using Selenium takes about 5 minutes. The Selenium IDE plugs into
Firefox as a standard add-on using XPI installation techniques. To
playback the tests in Internet Explorer, Opera, Safari, Chrome and
other browsers requires installation and configuration of Selenium RC.
Selenium RC uses a daemon architecture. Start the daemon using a simple
command-line call to start Java and run the Selenium RC JAR package.
Selenium RC installations take an hour or less. Selenium Grid installs
Selenium RC services on a farm of servers.
What
language is used to write the tests?
Selenium implements a domain specific language (DSL) for testing Web
applications. For example, the DSL implements commands to click a
button, type characters into a test field, and wait until text appears
in the page. Selenium implements the DSL as class library in Java,
package in Python, and Ruby, Groovy, C#, Perl, and PHP. The DSL has
approximately 200 commands. PushToTest teaches a 3-day introductory
class in Selenium. It takes 2-3 days for most students to become
proficient in the Selenium DSL.
How
well does the record/playback function work?
Selenium IDE is designed for Web 1.0 applications. In Web 1.0
environments Selenium's record/playback function works very well. For
Rich Internet Applications that use Ajax techniques and widgets, not so
much! Ajax is the Wild West of software development. Everything goes,
there is no sheriff, and no standards body exists. Consequently
Selenium does not know how to handle asynchronous applications where
objects load at their own pace and there is no "wait until idle"
function. Selenium misses Javascript driven clicks, Javascript created
frames and pop-up windows. Each miss means the test author needs to
manually add Selenium DSL commands.
Selenium IDE record/playback does not work well for tests that require
looping and conditional branching. These are possible by manually
coding Selenium DSL commands in a Java or other scripting language
environment. The solution is to use Selenium IDE's record feature to
create simple test use cases, transform them into a Java class, and
treat each use case as a component incorporated into a test suite.
There are emerging frameworks to help implement a component approach to
Selenium test authoring.
Is
there a coverage tool that plugs into Selenium?
ThoughtWorks Twist
is a tool to facilitate a continuous test and integration methodology
built on Selenium tests in a team-oriented development environment.
There may be others. There is a lot of excitement and energy in the
Selenium space so PushToTest wouldn't be surprised to find coverage
tools.
Are
there any missing features in Selenium? Is there a new release due soon?
A key drawback is Selenium's requirement to playback tests in a real
browser. When the browser needs to interact with a user the Selenium
test stops running. For example, when a browser moves from an HTTPS
secured page to an HTTP page many browser's security policy kicks in
and the browser asks the user to confirm the action. The Selenium
project is working on a next generation technology called WebDriver.
WebDriver uses each browser's native API to operate the test commands.
Selenium lacks a data production library system to provide operational
test data, lacks a way to repurpose tests into load tests, lacks a
platform to manage Selenium tests as test assets, and lacks a way to
derive the root cause to functional and performance issues. Thankfully
these are provided by many side projects in the Selenium biosphere,
including PushToTest, BrowserMob, SauceLabs, and others.
The words "coming soon" and Selenium are mutually exclusive. It took
the Selenium project 18 months to move from "beta" to "release
candidate." PushToTest is optimistic but not hopeful that Selenium 2.0
with WebDriver technology will appear in 2010.
The
Future

PushToTest
is building a new Ajax-based record/playback utility that will
output Selenese tests. This is aimed at providing an open source
alternative to HP QTP. The design is available at
http://downloads.pushtotest.com/201001/TM_IDE_Design.pdf

