了SoapUI从在Groovy响应得到附件

问题描述 投票:0回答:1

我试着用下面的代码从响应,在qazxsw POI文本得到附件。

Groovy

它包含了一些二进制信息太多,所以它不是完全可读,但在输出得到了以下几点:

Java.IO.byte array input stream@5哦擦74

groovy soapui bytearrayinputstream
1个回答
0
投票

这是很容易简单地将其编码为Base64并将其存储为一个属性值。

def testStep = testRunner.testCase.getTestStepByName("getData")
def response = testStep.testRequest.response
def ins =  response.attachments[0].inputStream
log.info(ins);
© www.soinside.com 2019 - 2024. All rights reserved.