Forum Discussion

satishpatil's avatar
satishpatil
New Contributor
10 years ago

Need help with Groovy Script

Hi All,

 

I am new to SOAPUI Groovy Scripting. I am not sure where to start.  There was a link to set and get properties(http://www.soapui.org/scripting---properties/tips---tricks.html#1-1-Get-and-Set-properties). It  uses implict objects like testRunner, context etc. Where can I find more info about implicit objects like methods and instance variables? I thought javadocs but  Javadoc for TestRunner( http://www.soapui.org/apidocs/com/eviware/soapui/model/testsuite/TestRunner.html) does not have variable testCase. Not sure looking at the right place. Any help appreciated.

3 Replies

    • nishantna's avatar
      nishantna
      Occasional Contributor

      The best way to study groovy script is through API documentation for SoapUI. If you dont know about methods defined in TestRunner or TestCase or any such variable then on groovy test step you should write something like the following code:

      log.info testRunner
      log.info testRunner.testCase

       and this will give you the class name for TestRunner or TestCase. After that, open the API documentation and go to the desired class name, clicking on which you will be introduced to a whole lot of methods.

    • nmrao's avatar
      nmrao
      Champion Level 3
      Hope you have found the link useful. Otherwise are you still looking for anything specific? Groovy Script, by defult context, log, testRunner vairables are available which you can see on the top of the script editor.