Testing Java applets with Squish/Java

Testing Java applets with Squish/Java

Since we released our new Squish/Java edition, we got asked a few times if it is possible to test java apples with Squish/Java.

While we don’t support testing applets running in a web browser yet, it is possible to test them through the appletviewer. On Windows, just create a batch file which looks like


c:\java\bin\appletviewer -J%SQUISH_JAVA_DEF_1% -J%SQUISH_JAVA_DEF_2% c:\java\demo\jfc\SwingApplet\SwingApplet.html

Similarly, on Linux create a shell script


#!/bin/sh
/usr/local/jdk/bin/appletviewer -J$SQUISH_JAVA_DEF_1 -J$SQUISH_JAVA_DEF_2 /usr/local/jdk/demo/jfc/SwingApplet/SwingApplet.html

Now set the batch file or script as AUT and start recording!

BTW: SQUISH_JAVA_DEF_1 and SQUISH_JAVA_DEF_2 are set by Squish when starting up the AUT and expand to some options to be passed to the Java runtime.

For future versions of Squish/Java we will add support for testing java applets in the web browser. That combined with Squish/Web will be then really powerful allowing to test the HTML page and java applet in an integrated test.

Well, we will post more about upcoming, exciting Squish 3.2 and Squish 4.0 features in the coming days and weeks. So stay tuned…