RodN
RodN

Reputation: 23

SoapUI reference attached file to edit contents?

I'm trying to modify the values of an attachment to a SOAP Request to correspond to values that I'm getting from a DataSource. I want to do this with a groovy script. I'm looking for a way to reference the attachment file path so I can edit the file itself but I'm having no luck finding that. Is there any way to do this?

Upvotes: 0

Views: 201

Answers (1)

RodN
RodN

Reputation: 23

I figured it out after looking at the API for a long time

import com.eviware.soapui.impl.wsdl.support.RequestFileAttachment
def xmlFile = testRunner.testCase.getTestStepByName("YOUR TEST STEP NAME").testRequest.getAttachmentAt(0).getUrl()

xmlFile will contain the full path of the attached file. Wanted to post this here in case someone else was looking for a quick way.

Upvotes: 1

Related Questions