Automating testing of JApplets

R

Rhino

I have a JApplet and I'm trying to think of some way to automate the testing
for it, to make sure that it still behaves properly after I make changes to
it.

The only Java testing tool I know is JUnit but it doesn't really lend itself
to testing applets. It seems to me that a test of an applet needs to have
expected images of what the applet is supposed to look like after each user
interaction: it should then initiate each user interaction and verify that
the actual image of the applet matches the expected image.

Can anyone suggest a tool, preferably freeware, that will do that?

Or is there some other way of testing applets that I haven't considered?
 
T

Thomas Weidenfeller

Rhino said:
The only Java testing tool I know is JUnit but it doesn't really lend itself
to testing applets. It seems to me that a test of an applet needs to have
expected images of what the applet is supposed to look like after each user
interaction: it should then initiate each user interaction and verify that
the actual image of the applet matches the expected image.

So you want to do GUI testing, but ...
Can anyone suggest a tool, preferably freeware, that will do that?

.... there are no really good GUI testing tools. Oh, of course, some work
well for some people, but most people simply give up after some time,
because providing and updating the "known good" data is always a
horrible task, and seldomly pays off.

If you really want to do something like this, then have a look at Java's
Robot class. Or check out things like jfcUnit. Google will reveal more
free tools.
Or is there some other way of testing applets that I haven't considered?

Not doing it at the GUI level, but only below the surface?

/Thomas
 
A

Andrew McDonagh

Rhino said:
I have a JApplet and I'm trying to think of some way to automate the testing
for it, to make sure that it still behaves properly after I make changes to
it.

The only Java testing tool I know is JUnit but it doesn't really lend itself
to testing applets. It seems to me that a test of an applet needs to have
expected images of what the applet is supposed to look like after each user
interaction: it should then initiate each user interaction and verify that
the actual image of the applet matches the expected image.

Can anyone suggest a tool, preferably freeware, that will do that?

Or is there some other way of testing applets that I haven't considered?

Depends upon what type of testing you want to do.

Unit tests are only useful for developers as they are written in a
programming language. If this is the type of testing you are after then
yes, JUnit and JFCUnit addon is a great combination.

If its more Acceptance testing you want to perform, as in: does the
applet load into a browser, is it servered by the webserver, does applet
work correctly given its un/signed nature, etc. Then JUnit is not the
tool. More importantly, these tests are written in a domain language
that is more naturally understood by testers and customers, which have
the added benefit of educating the development team about the domain
they are working upon.

Capture and record tools are notorious bad as they tend to be based on
exact co-ords and screen widgets, which tend to change frequently over a
projects life time.

The best tools I've used are (which are ALL free):


Watir (pronounced water): Web Application Testing In Ruby.
http://wtr.rubyforge.org/



Selenium (http://www.openqa.org/selenium/)

uses JavaScript and Iframes to embed a test automation engine in your
browser. There's even a demo you can run in your own browser, which
shows it loading and testing a page.

Demo of Passing Test
http://www.openqa.org/selenium/demo1/TestRunner.html

Demo of Failing Test
http://www.openqa.org/selenium/demo2/TestRunner.html



FIT (http://fit.c2.com/) is a testing framework, which uses HTML files
to specify the tests 'Fixtures' and your 'Fixture Code' to make them
work with your specific application.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top