小智 10
要存储响应消息的http标头中的值,您需要在REST请求测试步骤之后添加Groovy脚本测试步骤,以使用一些Groovy脚本.
下面的代码将检索特定响应标头属性的值:
def headerValue = testRunner.testCase.getTestStepByName("testStepName").httpRequest.response.responseHeaders["headerPropertyName"]
Run Code Online (Sandbox Code Playgroud)
将'testStepName'和'headerPropertyName'值更改为适合您的测试的值.
如果您想在进一步的测试步骤中使用此值,您需要将其存储为测试属性,以下链接应涵盖您需要的所有内容:
http://www.soapui.org/Scripting-Properties/tips-a-tricks.html#1-1-get-and-set-properties
归档时间: |
|
查看次数: |
13717 次 |
最近记录: |