Varun
Varun

Reputation: 597

How to debug soap UI scripts using Eclipse

I have written some libraries which is in groovy. My SOAP UI scripts which is currently used for API automation is using these libraries. As there is no debug option in SOAP UI Pro It is very hard to find the failures. Can someone help to debug the groovy script from eclipse. Which is called internally by a SOAP UI Script

Upvotes: 2

Views: 2844

Answers (2)

Rao
Rao

Reputation: 21349

Here is the way I get it done:

Instead of writing the logic in a groovy script using soapUI script editor, create groovy/java (user choice) class and its methods for the same logic. Here I assume that the script would have relative lots of lines code than fewer lines.

This has couple of advantages:

  • Intelli sense (which is not available if you write the same in soapUI tool)
  • Formatting of code
  • Easy debug
  • Maintenance of the code would be simple

Have a groovy/java project in the IDE of your choice (Intellij suits better for groovy projects, personal view only). Have the logic in the form of classes / methods. Compile those classes and create a jar file. Place it under SOAPUI_HOME/bin/ext directory.

Edit the soapui invoking script(SOAPUI_HOME/bin/soapui.sh on unix or .bat on windows) and add the debug parameters in JAVA_OPTS say
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006.

In the groovy script, just instantiate the above created class and call the appropriate method. Use arguments to your methods, that are available in groovy script context, log, testRunner etc variables. Even the script is done with fewer lines.

Debugging In Action: In your IDE, configure remote debugging and add your debug points where it is needed. And start debug.

Now, just run the groovy script. Go to IDE, it should stop at the point where you added the debug point. You should be to do run through it normally like how you do with java projects in your IDE.

This works best for me.

EDIT: Of course, this requires programming knowledge, know working in IDE (assuming that user knows as per the question) configuring build/class path etc.

Upvotes: 3

SiKing
SiKing

Reputation: 10329

Can't be done. SmartBear has been talking about this since at least 2007 (when SoapUI was still owned by Eviware), but still has not delivered. Here is one source: http://community.smartbear.com/t5/SoapUI-NG/Debugging-Groovy-scripts/td-p/33995

Upvotes: 2

Related Questions