polling must also be configured to time out after a
certain period.
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 JavaScript
try to launch browsers.
TestSwarm is different
because it lets any brows-
ers on the network con-
nect to it. This provides
a great advantage when
you are trying to test
multiple browsers and
platforms. To join the swarm with your
iPhone or Android, all you need to do is
go to the Web page of the TestSwarm
server with your browser. TestSwarm
can be used to run tests written in QUnit
(jQuery), Unit TestJS (Prototype), JSSpec
(Moo Tools), JSUnit, Selenium, and Dojo
Objective 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 technologies
have you been using to assist with
testing?
I am using Hudson, GlassFish
Server Open Source Edition, Oracle
VM VirtualBox, and Sun SPOT Java
Development Kits. Each of these tools
is open source and very flexible. I have
been able to integrate these tools with
other open source testing tools to pro-
vide an end-to-end automated testing
environment for Web applications. ●
JAVA IN ACTION
How can I automate running tests in
all 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 provide
continuous 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 someone
to set up a testing environment
similar to what you have built?
It should be fairly easy to set up a similar
environment. My team and I were able
to get a basic setup going in a few days.
Over time, we have slowly added more
“nice to have” features. All the tools I am
using are free and open source.
ABOUT US
What are some other tools that can be
used 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-
LEARN MORE
•;TestSwarm
•;QUnit
•;jQuery
•;GlassFish Server Open Source Edition
•;Sun SPOT Java Development Kit
•;JSLint
•;Closure Compiler
•;JUnit
•;Maven
•;Gradle
•;Ant
•;append To
•;FuncUnit
•;Hudson
•;Jenkins
•;Oracle VM VirtualBox
•;Canoo Web Test
•;Rhino
•;Selenium
blog