Forum Discussion
omatzura
18 years agoSuper Contributor
Hi Jerry,
try the following for adding an existing "CartAdd" request named "Request 1" to the current testcase as a TestRequest with a SoapResponse assertion..
You need to be sure that the name specified in the createConfig call is unique for the testcase, otherwise a prompt will be displayed for a new name..
Hope this helps!
regards,
/Ole
eviware.com
try the following for adding an existing "CartAdd" request named "Request 1" to the current testcase as a TestRequest with a SoapResponse assertion..
import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestRequestStepFactory
import com.eviware.soapui.impl.wsdl.teststeps.assertions.SoapResponseAssertion
// get request
def iface = testRunner.testCase.testSuite.project.getInterfaceByName( "AWSECommerceServicePortType" )
def request = iface.getOperationByName( "CartAdd" ).getRequestByName( "Request 1" )
// create config and add teststep
def config = WsdlTestRequestStepFactory.createConfig( request, "CartAdd RequestStep" )
def testStep = testRunner.testCase.insertTestStep( config, -1 )
// add a soapresponse assertion
testStep.testRequest.addAssertion( SoapResponseAssertion.ID )
You need to be sure that the name specified in the createConfig call is unique for the testcase, otherwise a prompt will be displayed for a new name..
Hope this helps!
regards,
/Ole
eviware.com