Forum Discussion
PaulDonny
11 years agoRegular Contributor
If you are working outside of SoapUI itself check out this thread. It is some snippets of a Java project I created that builds SoapUI project files from WSDLs. It also gives the ability to parse the XML a bit but it's a bit older.
If you are working within SoapUI
If you are working within SoapUI
import com.eviware.soapui.impl.wsdl.teststeps.registry.*;
import com.eviware.soapui.impl.wsdl.teststeps.*;
//Uncomment below to import WSDLs
//import groovy.io.FileType
//def list = []
//def dir = new File("C://WSDLS")
//dir.eachFileRecurse (FileType.FILES) { file ->
// list << file
//}
//for ( file in list ) {
// testRunner.testCase.testSuite.project.importWsdl(file.toString(),true)
//}
def testSuiteName = "TestSuite";
EWHtestSuite = testRunner.testCase.testSuite.project.addNewTestSuite(testSuiteName);
for (iFace in testRunner.testCase.testSuite.project.getInterfaceList()) {
if (iFace.getName().matches(".*?[0-9]")) {
EWHtestCase = EWHtestSuite.addNewTestCase(iFace.getName());
EWHtestCase.setKeepSession(true);
log.info EWHtestCase.addTestStep(((WsdlTestStep)testRunner.testCase.getTestStepByName("Login")).getConfig())
for (operation in iFace.getOperationList()) {
TStepC = WsdlTestRequestStepFactory.createConfig(operation, operation.getName());
testStep = EWHtestCase.addTestStep(TStepC);
}
}
}
Related Content
Recent Discussions
- 15 years ago