我正在尝试使用简单的时髦脚本自动创建项目。我已经设法创建新项目,导入 wsdl,但我坚持导入测试套件。测试套件是从另一个项目导出的,它位于.xml文件中这是我到目前为止所拥有的:
import com.eviware.soapui.impl.wsdl.*
import com.eviware.soapui.impl.WsdlInterfaceFactory
String ProjectName = "D:/work/Project/testProject.xml";
String TestWSDL = "D:/work/WSDL/AWSECommerceService.wsdl";
String tstTestSuite = "D:/work/testSuites/suite.xml";
log.info ("Path to WSDLs:");
log.info ("TestWSDL - $TestWSDL");
log.info ("Path to testSuite:");
log.info ("testsuite- $tstTestSuite");
def currentProject = testRunner.testCase.testSuite.project;
WsdlProject project = new WsdlProject();
WsdlInterface iface1 = WsdlInterfaceFactory.importWsdl(project,TestWSDL, true )[0]
//Import of testsuite should go here
project.saveAs(ProjectName);
使用importTestSuite
方法将现有的测试套件文件使用到项目中似乎很简单。
这是实现相同目的的代码片段。
project.importTestSuite(new File(tstTestSuite))