Forum Discussion

malziotti's avatar
malziotti
Occasional Contributor
3 years ago

Script library

Good morning
I wrote a groovy script with ReadyApi version 3.30.0, saved in <ReadyApi>\bin\scripts folder.
Everything works correctly!
Now I would like to share the project with a colleague who use SoapUi free version (version 5.7.0).
In the following link:
https://www.soapui.org/docs/scripting-and-properties/scripting-and-the-script-library/
you wrote that to access the Groovy Library path you need to select:
File> Preferences> SoapUI tab> Script Library.
Unfortunately, after selecting File> Preferences, I can't find the SoapUI tab (see attachment)

How can I indicate the path of the Groovy Library in the SoapUi free version?
Thanks.

 

Marco Malziotti

  • TNeuschwanger's avatar
    TNeuschwanger
    Champion Level 1

    Hello malziotti 

     

    Yep... i do not see that feature in SoapUI.  Their documentation must have gotten disconnected with their versions as they have matured over the years.

     

    The value you are interested in ReadyAPI is stored in the "readyapi-settings.xml" file.  SoapUI has a corresponding  "soapui-settings.xml" file.  I have not done this to test it out, but it might work...

    You will have to carefully edit the "soapui-settings.xml" file to include the following line as illustrated below...

     

    Before:

    .
    .
    .
    <con:setting id="HttpSettings@include_request_in_time_taken">true</con:setting>
    <con:setting id="HttpSettings@include_response_in_time_taken">true</con:setting>
    <con:setting id="UISettings@auto_save_interval">0</con:setting>
    <con:setting id="WsaSettings@soapActionOverridesWsaAction">true</con:setting>
    <con:setting id="WsaSettings@overrideExistingHeaders">true</con:setting>
    .
    .
    .
    

    After:

    .
    .
    .
    <con:setting id="HttpSettings@include_request_in_time_taken">true</con:setting>
    <con:setting id="HttpSettings@include_response_in_time_taken">true</con:setting>
    <con:setting id="Script Library">C:\Data\SmartBear\somewhere\scripts</con:setting>
    <con:setting id="UISettings@auto_save_interval">0</con:setting>
    <con:setting id="WsaSettings@soapActionOverridesWsaAction">true</con:setting>
    <con:setting id="WsaSettings@overrideExistingHeaders">true</con:setting>
    .
    .
    .
    

     

    You can try it out to see if that file modification works for you.  Edit your "Script Library" value as you desire on where to point to your scripts folder.

     

    Regards,

    Todd

    • malziotti's avatar
      malziotti
      Occasional Contributor

      Thank Todd
      Unfortunately, your proposal is not conclusive for me.

      I use SoapUI-5.7.0 free version, added line:

      <con:setting id="Script Library">C:\Program Files\SmartBear\SoapUI-5.7.0\bin\scripts</con:setting>

      on %USERPROFILE%\soapui-settings.xml

      Saved script on folder C:\Program Files\SmartBear\SoapUI-5.7.0\bin\scripts\soapui\utils\

      Restart SoapUI-5.7.0 and trying to mock up, i got the following error:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 2: unable to resolve class soapui.utils.SingleBehavior

      I am attaching the project and the groovy script.

      Thanks. 

      Marco Malziotti