A company called
append To developed
an open source jQuery
plug-in, whenAvailable,
that can be used if you
are using jQuery. The
whenAvailable plug-in
continues polling for a
Document Object Model
(DOM) element before
proceeding.

You can also use FuncUnit to help
with the challenges of functional testing. FuncUnit is an add-on to QUnit that
provides functional testing capabilities.
FuncUnit exists to solve the problem of
waiting for an element to appear before
continuing your test.

run tests. The TestSwarm
server keeps track of the
results of tests that have
been run.

Most continuous inte-gration tools for JavaScripttry to launch browsers.TestSwarm is differentbecause it lets any brows-ers on the network con-nect to it. This providesa great advantage whenyou are trying to testmultiple browsers andplatforms. To join the swarm with youriPhone or Android, all you need to do isgo to the Web page of the TestSwarmserver with your browser. TestSwarmcan be used to run tests written in QUnit(jQuery), Unit TestJS (Prototype), JSSpec(Moo Tools), JSUnit, Selenium, and DojoObjective Harness.

Without automated
regression testing,
bugs will haunt you.
It is very common for
bugs that have been
fixed to come back
again later.

VirtualBox is used to run four operating
systems that run 10 different browsers.
Oracle VM VirtualBox has a Web Service
API that can be used to stop and start
virtual environments. My team and I
wrote another Hudson plug-in to restart
the virtual environments once a day.

Hudson provides a REST-style API that
has an XML API that shows the status
of builds. I am using Sun SPOT Java
Development Kits to poll Hudson’s XML
API. Each Sun SPOT Java Development
Kit has eight LED lights, so I can monitor
eight builds at a given time.

velopers. QA developers will probably be
more comfortable with Selenium.

What Java and Oracle technologieshave you been using to assist withtesting?I am using Hudson, GlassFishServer Open Source Edition, OracleVM VirtualBox, and Sun SPOT JavaDevelopment Kits. Each of these toolsis open source and very flexible. I havebeen able to integrate these tools withother open source testing tools to pro-vide an end-to-end automated testingenvironment for Web applications. ●

JAVA IN ACTION

How can I automate running tests inall browsers?

TestSwarm is a Mozilla Labs project that
provides distributed continuous integration testing for JavaScript. Browsers
can connect to the TestSwarm server to
become part of the swarm of browsers
that tests will be run against.

To run a test, you submit a simple
form telling TestSwarm what tests to
run and what browsers to run the tests
in. The tests are run in an iFrame in
each browser that is part of the swarm.
Once each test is completed, the results
of the tests are sent to the TestSwarm
server. TestSwarm is a PHP application
that manages the process of telling the
connected browsers in the swarm to

What tools are you using to providecontinuous integration?

I have been using Hudson/Jenkins on
GlassFish Server Open Source Edition
to trigger running tests in TestSwarm.
My team and I wrote a Hudson plug-in
to integrate Hudson with TestSwarm.
Hudson monitors my repository for code
check-ins. When a code check-in occurs,
Hudson uses the plug-in I developed
to submit a new job to TestSwarm. The
plug-in then polls TestSwarm for the
results. If there are errors in the test,
Hudson sends out an e-mail notification.

I am using Oracle VM VirtualBox to
help manage the browsers that are
connected to TestSwarm. Oracle VM

How difficult would it be for someoneto set up a testing environmentsimilar to what you have built?It should be fairly easy to set up a similarenvironment. My team and I were ableto get a basic setup going in a few days.Over time, we have slowly added more“nice to have” features. All the tools I amusing are free and open source.

ABOUT US

What are some other tools that can beused for testing Web applications?

Before I started working with QUnit
and TestSwarm, I mostly used Canoo
Web Test. Canoo Web Test allows you to
write your tests in XML or Groovy. Canoo
Web Test runs from the command line
using Rhino.

Selenium is another great tool that
has been very popular for testing Web
applications. Selenium has a click-and-record feature that allows you to write
simple tests easily. I prefer using QUnit
because of its simplicity and power.
QUnit is a great tool for JavaScript de-