The very first thing that I must say: I did not quite get it to work, yet! I am hoping that somebody out there will read this and prod me in the right direction to get the last bit to work – please be gentle.
Step 1: ready SoapUI
You need the Pro version to get this to work, because using this technique you can only debug stuff in the Groovy Script Library.
I have two installations of SoapUI: version 4.0.1 that I use just for debugging, and version 4.0.2 SNAPSHOT that I use for all other work. But that might be a little overkill.
- Download/install/configure SoapUI Pro. The most important thing is that you need to refactor any script you want to debug into the script library.
- Download and unpack the SoapUI source into the same directory as the installation.
- Modify the SoapUI Bootstrap Script; depending on which platform you are running this is going to be in $SOAPUI_HOME/bin/soapui-pro.sh or %SOAPUI_HOME%\bin\soapui-pro.bat if you’re a Window$ weenie. The last line of the script reads something like:
java $JAVA_OPTS -cp $SOAPUI_CLASSPATH com.eviware.soapui.SoapUIPro "$@". Modify it to say
java $JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8666 -cp $SOAPUI_CLASSPATH com.eviware.soapui.SoapUIPro "$@". The details of what this does can be found in this DW article, by Charles Lu.
Step 2: ready Eclipse
Don’t bother with the Eclipse-SoapUI plugin; not only does it not support any of the Pro features, but it is completely useless.
- Download/install/configure Eclipse. I personally prefer Eclipse for Testers, with the Java tools and Groovy tools installed.
- Create a new Groovy project and import into it your SoapUI project. Make sure you specify that your scripts folder is where your source files are stored.
- You will need to link in the soapui-pro-4.0.1.jar library with the attached sources, as well as everything in the lib directory as a user library.
- Create a New Debug Configuration. It is going to be a Remote Java Application running on localhost:8666 to match the port specified when launching SoapUI above.
Step 3: debug
- Start SoapUI from the modified script. You should see a message something like: Listening for transport dt_socket at address: 8666.
- Fire up Eclipse and start the debug configuration. It should connect to the already running SoapUI.
- In Eclipse, in one of your scripts set a breakpoint. In SoapUI run the test that contains this script.
- My Eclipse Debug session stops in the correct spot, however:
Would appreciate any hints how to resolve this.