Forum Discussion

msandoval's avatar
msandoval
Occasional Contributor
2 years ago

Correct way to set project file path for WsdlProjectPro in composite project

hi, i'm working with a composite project and I'm trying to declare the project variable as mentioned on the docs (under Workspace-related scripts) but I'm not sure on which file path I'm supposed to...
  • msandoval's avatar
    2 years ago

    Hi,

    I got the solution via Smartbear support last week so here they are:

     

    import com.eviware.soapui.impl.wsdl.WsdlProjectPro
    
    // option 1
    def path = context.expand( '${=project.getPath()}' )
    log.info("loading from path in context")
    def project1 = new WsdlProjectPro(path) // <-- this was the code I was looking for at the beginning
    
    // option 2
    log.info("loading from testRunner.getTestCase().getTestSuite().getProject()")
    def project2 = testRunner.getTestCase().getTestSuite().getProject()

    option 1 gave me an iss ue where it wasn't updating some test project variables =C

    option 2 was the winner 😃