Forum Discussion

jsolano's avatar
12 years ago

groovyUtils.projectPath returning empty string

Hi guys,

I'm currently following the instructions of the video tutorial found here: http://www.soapui.org/Service-Mocking/c ... vices.html.

I'm using the SoapUI free version, and this is the code I have so far:

import com.eviware.soapui.support.GroovyUtils
import groovy.xml.XmlUtil

def groovyUtils = new GroovyUtils(context)

def xmlParser = new XmlParser()
def responseContent

responseContent = xmlParser.parse( groovyUtils.projectPath + "/responses/login-response.xml" )

context.content = XmlUtil.serialize( responseContent )


In the tutorial works fine, but it's not working for me. After sending a simple request, I get a
FileNotFoundException
.

After double-checking that the login-response.xml file exists, and it's on the specified path, I included this line to see the value of the project path:

println "PATH: " + groovyUtils.projectPath


In the soapui console I only see: "PATH: ", as if the projectPath was an empty string.

Am I missing something here? Any help will be much appreciated.

1 Reply

  • SiKing's avatar
    SiKing
    Community Expert
    Works for me dude.

    I don't understand:
    jsolano wrote:

    println "PATH: " + groovyUtils.projectPath


    In the soapui console I only see: "PATH: ", as if the projectPath was an empty string.


    println sends stuff to standard output. To get stuff to go to the SoapUI Log Output, try:
    log.info groovyUtils.projectPath

    You could also try:
    log.info context.expand('${projectDir}')