Automating applications with both the Web and Java editions

Last edited on


Squish for Web allows to automate Java applications as well (provided your Squish license includes Java).

This article explains the necessary steps to automate a Java application with Squish for Web.

Java Applets

If you have a Java applet, you should not have to do anything special. Record as usual.

Java Web Start

Java applications that get started via Java Web Start (by a click on a link in a web page) can also be automated with Squish for Web.

The Web Start application should be hooked automatically and should be available as a separate application context.

Stand-alone Java Application

If you want to automate a Java stand-alone application in addition to the web browser you need to use Squish for Web and a Squish for Web test suite. (Use Squish for Web to create the test suite.)

Then, because you are using Squish for Web, you need to tell Squish to use the so called Java wrapper for your Java application (“MyJavaApp”).


testSettings.setWrappersForApplication("MyJavaApp", ("Java"))


testSettings.setWrappersForApplication("MyJavaApp", ["Java"]);


testSettings setWrappersForApplication MyJavaApp { Java }

Perl test scripts:

testSettings->setWrapperssForApplication("MyJavaApp", ("Java"));

Then start your application like this:


Setting the Application Context for Web and Java

In case you want to start the Java application before the Web application, you will have to store the default application context of the Web Test Suite. For example in a Python script:

def main():
    webContext = defaultApplicationContext()

    testSettings.setWrappersForApplication("MyJavaApp", ("Java"))
    javaContext = startApplication("MyJavaApp")

    # Automate Java application here


    # Automate Web application here

You can switch back to the application context of the Java application by calling setApplicationContext(javaContext).

Further information