Forum Discussion

jkrier's avatar
Regular Contributor
9 years ago

Groovy script for running curl commands

Does anyone know how to run a curl command using a Groovy script inside SoapUI? I found some JS scripts that supposedly do this but I think you need Test Complete to run them as they all fail for me in SoapUI

  • Looks like curl was not found on the path. Try specifying the complete path of the executable, ie "/usr/bin/curl"



    Ready! API developer

4 Replies

    • jkrier's avatar
      Regular Contributor

      I get an error when I run that


      • Sat Sep 05 12:26:37 MDT 2015:ERROR:groovy.lang.MissingPropertyException: No such property: org for class: Script1
      • groovy.lang.MissingPropertyException: No such property: org for class: Script1
      • at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(
      • at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(
      • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(
      • at
      • at
      • at$
      • at
      • at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$
      • at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      • at java.util.concurrent.ThreadPoolExecutor$ Source)
      • at Source)
      • jkrier's avatar
        Regular Contributor

        I tried shortening the script as some of the timesampt stuff isn't necessary for me and then I get an error when trying to execute the curl command, which is what I am use to seeing


        modified script

        def proc = "curl https://hostname/manager/text/list/".execute()
        // cURL uses error output stream for progress output.
        Thread.start { System.err << proc.err }
        // Wait until cURL process finished and continue with the loop.


        ERROR Cannot run program "curl": CreateProcess error=2, The system cannot find the file specified error at line: 1