Introduction¶
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
Unzip Squish ZIP package.
Run
<SQUISH_DIR>/bin/squishconfig --java=<JRE>
.Replace
<JRE>
with the directory of the JRE (Java Runtime Environment) of the AUT (Application Under Test) (see Finding the JRE that executes a Java application ).
Step #1 - Recreate <SQUISH_DIR>/lib/squishrt.jar
On Windows:
Start cmd.exe (Start button > Run..., enter "cmd.exe" (without quotes), press RETURN/ENTER).
In cmd.exe execute:
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:
Unix shell script example:
Windows batch file example:
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
Unix shell script example:
Windows batch file example:
Step #4 - Use the batch file/shell script from Step #3 as AUT in the Squish test suite settings.