Hi Rupert,
You know anything of scripting in Groovy?
I got some that seems to work, but there is 1 thing i can't seem to figure out.
What i have so far:
1: excel with 2 columns; name and url
2: project with datasource and groovy script.
I open the project en when i run it, it first gets the name and url from the datasource
It then makes a project with the wsdl (url) from the datasource.
That goes well!
Now i need to add the next step: adding a testsuite and testcase.
I have this working also, except for 1 annoying thing...the testsuite and testcase are added under my original project and not under the one i just made.
here is the script i found and am altering:There is something wrong with the red part...Can you see what i am doing wrong?
Thanks in advance!!
//some blabla, dunno what for
import com.eviware.soapui.impl.wsdl.*
import com.eviware.soapui.impl.WsdlInterfaceFactory
//getting variables URL and Name
def url = context.expand( '${DataSource#url}' )
def currentProject = testRunner.testCase.testSuite.project
def project1 = testRunner.testCase.testSuite.project
String projectName = context.expand( '${DataSource#naam}' )
//guess this actually makes the project
WsdlProject project = currentProject
.getWorkspace()
.createProject(projectName, new File(projectName + ".xml"))
WsdlInterface iface = WsdlInterfaceFactory.importWsdl(project, url, true )[0]
//something is wrong here. My goal with these lines is to make the newly made project active so that the suite is made in that project
//Doesn't work! I need to switch from project A to Project B here...
import com.eviware.soapui.impl.wsdl.*
WsdlProjectPro project2 = new WsdlProjectPro('${DataSource#naam}');
currentProject = testRunner.testCase.testSuite.project2.name == '${DataSource#naam}'
//here the suite and testacses are made
suite = context.testCase.testSuite.project.addNewTestSuite("test")
tc = suite.addNewTestCase("test case")
context.testCase.testSuite.project.save()