Ask a Question

Automate SoapUI

rupert_anderson
Valued Contributor

Re: Automate SoapUI

Actually, it does save it like yours (with a tweak) -  maybe this is the neatest I can get it:

 

import com.eviware.soapui.SoapUI
import com.eviware.soapui.impl.WsdlInterfaceFactory
import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestRequestStepFactory

def projectName="TESTPROJECT1"
def projectPath="/Users/test/soapui projects/$projectName-soapui-project.xml"

def project = SoapUI.workspace.createProject(projectName, new File(projectPath))

//Replace this with your WSDL
def iface = WsdlInterfaceFactory.importWsdl(project,"http://www.webservicex.com/globalweather.asmx?WSDL", true)[0]

def newTestCase = project.addNewTestSuite("testsuite1").addNewTestCase ("testcase1")

for (operation in iface.getOperationList()) {
	testStepConfig = WsdlTestRequestStepFactory.createConfig(operation, operation.getName())
	newTestCase.addTestStep(testStepConfig)
}

Cheers,

Rup

Author of SoapUI Cookbook
cancel
Showing results for 
Search instead for 
Did you mean: