Forum Discussion
Kronos_-_soapUI_1
14 years agoOccasional Contributor
Hi Erik. I've worked around the problem by dynamically loading WsdlProjectPro if it's not running from the command line. This works for my situation, and it compiles and executes fine when run from the command line in the open source version. I know there are easier ways to get the project handle , but this is what I was using as I was stumbling around for a solution.
import com.eviware.soapui.impl.wsdl.WsdlProject
import com.eviware.soapui.impl.wsdl.WsdlTestSuite
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase
import java.io.File
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context);
def thisProjectDir = groovyUtils.projectPath
File f = new File(thisProjectDir, "\\..\\MyProject\\MyProject.xml");
String absolute = f.getCanonicalPath()
if (!com.eviware.soapui.SoapUI.isCommandLine())
// running in the ProUI
{
project = Class.forName("com.eviware.soapui.impl.wsdl.WsdlProjectPro").newInstance(absolute);
}
else {
// running in the free version via testRunner.bat
project = new WsdlProject(absolute)
}