Hooking Java applications without "Java Agent"

Last edited on


In cases where hooking Java applications fails despite the correct set up of Squish (run Squish’s setup and choose the JRE (Java Runtime Environment) which is used by the AUT (Application Under Test) (see Finding the JRE that executes a Java application) it is worthwhile to try this alternative hooking approach which does not use the Java Agent functionality of the JVM (Java Virtual Machine) and which Squish uses by default.

Hooking without Java Agent

Step #0 - Set up Squish

Step #1 - Recreate <SQUISH_DIR>/lib/squishrt.jar

On Windows:

Step #2 - Ask your developers for a shell script (Unix) or batch file (Windows) to start the AUT via “java”

Such a batch/script file could look similar to these examples:

Step #3 - Modify the shell script/batch file from Step #2 to unset environment variable JDK_ALTERNATE_VM and use environment variables SQUISH_JAVA_DEF_1, SQUISH_JAVA_DEF_2, SQUISH_JAVA_DEF_4

Step #4 - Use the batch file/shell script from Step #3 as AUT in the Squish test suite settings.