Forum Discussion

jose_cruz's avatar
17 years ago

Groovy function accessible to all tests

Hi,

I am using the free version of SOAPUI 2.5.1 and I am trying to write a function or subroutine that I can use or call from any groovy script test step. Ex.

// this is the part i want to be reusable in any test step from any test case
// in the same test suite...

// subroutine example
def add (num1, num2) {
num1 + num2
}



// an example of the calling line that i can call in any groovy script test step
// from any test case belonging to the same test suite

log.info "" + add(1, 2)


Any help is much appreciated.

Thanks.

3 Replies

  • Hello!

    Unfortunately, this cannot be done in the free version of soapUI. The PRO version adds support for this as described here.

    Regards,
    Dain
    eviware support
  • Has this changed in past 2 years? Can you confirm that it still cannot/can be done in free SoapUi 3.6.1?

    Regards,
    NGC
  • Hi,

    yes, this is still the same, ie unless you package your routines in a custom jar that you put in the bin\ext folder you need to use soapUI Pro to get the script-library functionality

    regards!

    /Ole
    eviware.com