msandoval
2 years agoOccasional Contributor
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 put in
code from docs:
import com.eviware.soapui.impl.wsdl.WsdlProjectPro
WsdlProjectPro project = new WsdlProjectPro("The full path to the project file")
I tried the following:
- using the file project.content
- using the project folder path
neither of those work, so, which is the correct path I need to put in?
also, this is the current path of the project folder: C:\git\TestProject
Thanks!😀
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 😃