Forum Discussion

victornw's avatar
13 years ago

Send Attachments between TestRequest

Hi, I’m new using SoapUI and I have a little problem.
First, sorry for my bad English, and second, I’m trying to do a TestCase with these steps:

1.TestRequest that response with two attachment.
2.Groovy Script for save the response attachments in two files.
def testStep = testRunner.testCase.getTestStepByName( "extract" )
def response = testStep.testRequest.response
def FicheroXML = new java.io.FileOutputStream( "seg.xml")
def FicheroZIP = new java.io.FileOutputStream( "plant.zip")
def salidaXML = response.attachments[0].inputStream
def salidaZIP = response.attachments[1].inputStream
com.eviware.soapui.support.Tools.writeAll( FicheroXML, salidaXML )
com.eviware.soapui.support.Tools.writeAll( FicheroZIP, salidaZIP )


And now I want to use this two files like an input attachment for the next Request, but I only find an instruction valid for 1 file:
testRunner.testCase.testSteps["construct"].getHttpRequest().attachFile(file, true)


If anyone can help me, I will be very grateful.
Thanks!!!
No RepliesBe the first to reply