Groovy Scipting for SoapUI

(Mark) #1

Hi All,

I have just started learning SoapUI Automation using Groovy. I wondered if anybody knew of a good resource for Groovy scripting which is applicable to SoapUI / testing. A lot of the Cookbooks and tutorials are aimed at Developers.

1 Like
(Magda) #2

Hi Mark,

whether as tester or developer, knowing the basics of a programming language is helpful. You can still learn a lot about syntax, conventions, basic data structures and libraries/modules from general purpose tutorials. Depending on what sort of APIs you work with, for starters you can look into working with JSON (http://groovy-lang.org/json.html) and XML (http://groovy-lang.org/processing-xml.html) and into reading files from the system (http://docs.groovy-lang.org/latest/html/documentation/#_working_with_io). You won’t need the compiler etc. topics as SoapUI provides the environment for you.

Once you have an idea how the language works, look explicitly for SoapUI example projects/scripts on the net and play around with the samples. You may need to look deeper as a lot of features that required scripting earlier are covered by the newer pro versions of the tool (which may also reduce the initial learning load for you unless you’re past that stage already).
One example I find both eternally useful and relatively easy to play with is https://www.belatrixsf.com/blog/a-groovy-kind-of-trick-for-soapui-free-in-eight-steps/ - just going through a script and looking up things as you go, then trying to adapt it for your own project is a good learning experience. SmartBear seems to have published some sample projects as well at https://github.com/SmartBear/soapui-groovy-examples but I haven’t looked into them so can’t say how helpful they are. Even a small stepping stone can help you get ahead though.

Good luck on your Groovy adventures!

2 Likes
(Anders) #3

Personally, I find Groovy in SoapUI sucks a bit. API docs are lacking and debugging is really a pain (we’re back to console printing). Other than that it’s okay, and it can certainly do string operations, setting custom id’s, assigning and reading properties, writing files and that kind of stuff.

I agree with Magda that playing around with the language is probably a good idea to begin with.

Are you looking for aything specic? SoapUI is dated, but ubiqtous. Some of us like it for both reasons :slight_smile:

1 Like
(Mark) #4

Hi Anders,

Thanks a lot for your reply.

To be honest, I chose Soap as it covers but Rest and Soap and Postman only covers Rest.

What do you normally use for your Service testing?

Thanks

Mark