Groovy Script to Create Multiple SOAP Request
Hi,
I have a requirement to Groovy Script to create : Project->Suite->Test Case->Test Steps(Multiple SOAP Request). Below code is creating one SOAP Request. But I want to create more than one SOAP Request using Groovy Script. I am getting error because i am trying to create multiple requests. Would you please help me. How to create multiple SOAP Request using Groovy Script.
import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestRequestStepFactory
import com.eviware.soapui.impl.wsdl.teststeps.registry.GroovyScriptStepFactory
def suite = context.testCase.testSuite.project.addNewTestSuite("Customer")
def tc = suite.addNewTestCase("CustomerUpdate")
String[] requests= ["CustomerInsert", "CustomerUpdate", "CustomerDelete"]
def operation = testRunner.testCase.testSuite.project.getInterfaceAt(0).getOperationList()[0]
def factory = new WsdlTestRequestStepFactory()
for(int i=0;i<3;i++)
{
def config = factory.createConfig(operation,requests)
def testStep = tc.addTestStep(config)
}
testStep.properties['Request'].value = '<request>someData</request>'
context.testCase.testSuite.project.save()