To attach to a Java application started by Eclipse the following steps can be used. (These steps are tailored towards Windows but should be easy to adapt for other systems.)
Start Eclipse process with additional environment variables (in cmd.exe or a .bat/batch file):
Run Configurations... >
VM arguments insert this:
Start Eclipse via
Run Configurations... to execute your Java application. It should then start in attachable mode automatically. (You may see the Windows firewall asking for permission to allow
javaw.exe (or so) network access.)
In the Squish IDE register an
Attachable AUT at
Server Settings >
Manage AUTs..., for example with
Host “127.0.0.1” and
Port “4444” (all without double quotes).
attachToApplication() into an existing test script instead of
If you set a breakpoint on the
snooze() command you can execute to that breakpoint and then inspect the application (if attaching to it succeeded).