Forum Discussion
Kronos_-_soapUI_1
14 years agoOccasional Contributor
Hi Erik - actually that code was never going to work due to the ClassCastException between WsdlProjectPro and WsdlProject. This is the code I'm using now.
import com.eviware.soapui.impl.wsdl.WsdlProjectPro
import com.eviware.soapui.impl.wsdl.WsdlTestSuite
import com.eviware.soapui.support.types.StringToObjectMap
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase
workspace = testRunner.getTestCase().getTestSuite().getProject().getWorkspace()
wsdlProject = workspace.getProjectByName("TestCase Library")
libraryPath = wsdlProject.getPath()
tcLibrary = new WsdlProjectPro(libraryPath)
WsdlTestSuite wsdlTestSuite = tcLibrary.getTestSuiteByName("TestCase Library")
WsdlTestCase wsdlTestCase = wsdlTestSuite.getTestCaseByName("SetGlobalProperties")
wsdlTestCase.run(new StringToObjectMap(context),false)