Forum Discussion
I various reasons for using Groovy. In one case I needed to make a system call to run a bash script then format the standard output and feed the output into the value part of a json object for the request.
In another case I needed to read in a response value from the previous step and put that value in a json object for another request.
And then I had some json requirement that had two words (blank space) in some name fields. I needed to work with Groovy to get that going.
I use Groovy in the assertion script to check for a specific value in our case "Success"
I also use Groovy at the test suite level Setup Script to set the SSL keystone password and keystone location.
Hi Bill,
Thank you. These are just the sorts of things I use Groovy for too. IMHO, it's the ability to script where there isn't a standard step that makes SoapUI so powerful.
Chris
- nmrao9 years agoCommunity HeroChrisA,
SoapUI provides user to utilize the power of groovy within the tool.
Generally, I put the groovy scripts related to SoapUI in my github repot, may be it is possible to refer in case if there is a need.
https://github.com/nmrao/soapUIGroovyScripts
Of course, you can search for similar questions here in this forum or stackoverflow as well.- ChrisA9 years agoContributor
Hi,
Agreed. When I first started using SoapUI and more specifically, Groovy scripting, my scripts tended to be script assertions.
The script assertion would contain Groovy that I copied and pasted to other tests. It didn't take long for this to become unmanageable, so I then started creating external classes that sit in the bin/scripts folder of SoapUi. The script assertion only then needs to create an object from the class and run the main method.