Linked Questions

Popular Questions

SoapUI. Add multipart body part using groovy

Asked by At

I need to add json as multipart body part to "multipart/form-data" request using groovy.

I can do this using file attachments:

testRunner.testCase
          .testSteps["/job/result"]
          .getHttpRequest()
          .attachBinaryData(json.toString().getBytes(), "application/json").contentID = "info"

My problem is "attachBinaryData" creates a temp file per request. It is not good for load tests :)

Is there other possibility to add body parts, without file attachments?

something like :

testRunner.testCase
              .testSteps["/job/result"]
              .getHttpRequest()
              .addBodyPart("application/json", json.toString())

P.S. it must be the "add", because request has also one static attachment.

Related Questions