Almost there...i found some code that does what i want.
Only thing is...it does work, but looks at the wrong project...
My full code is now:
import com.eviware.soapui.impl.wsdl.*
import com.eviware.soapui.impl.WsdlInterfaceFactory
import com.eviware.soapui.impl.wsdl.teststeps.*
def url = context.expand( '${Lees wsdl vanuit excel#url}' )
def projectName = context.expand( '${Lees wsdl vanuit excel#naam}' )
def currentProject = testRunner.testCase.testSuite.project
def workspace = testRunner.testCase.testSuite.project.workspace
WsdlProject project = currentProject
.getWorkspace()
.createProject(projectName, new File(projectName + ".xml"))
WsdlInterface iface = WsdlInterfaceFactory.importWsdl(project, url, true )[0]
//Lees wsdl vanuit excel
//def project = workspace.createProject(projectName, new File(projectName + ".xml"))
suite = project.addNewTestSuite("testsuite1")
tc = suite.addNewTestCase ("testcase1")
//new part for making the teststeps
for (iFace in testRunner.testCase.testSuite.project.getInterfaceList()) {
//for (iFace in testRunner.tc.suite.project.getInterfaceList()) {
if (iFace.getName().matches(".*?[0-9]")) {
for (operation in iFace.getOperationList()) {
TStepC = WsdlTestRequestStepFactory.createConfig(operation, operation.getName());
testStep = tc.addTestStep(TStepC);
}
}
}
The last part works, if i copy the script to the newly made project and run it there.
It doesn't work if i keep it in the starting project.
Either the getInterfaceList or the getOperationList commando is looking at the wrong project.
The code supposes to make a new project, with a new testsuite, a new testcase and new teststeps.
Up till making a new testcase, it works fine. It makes a brandnew Testcase in the new project.
The last part, the new teststeps are however not made in the new project..
Can anyone help me out to straighten this out? Should be such a small thing, but i have been staring and trying for hours now and i cannot seem to get it right...