如何在Soap UI中根据请求中的值检查响应的值

  • 本文关键字:响应 请求 Soap UI soap soapui assert
  • 更新时间 :
  • 英文 :


我是一个新的Soap UI用户,所以传达我的请求的最简单的方法是使用一个基本的场景。在最基本的级别上,我发送两个数字,服务返回这两个数字的相加。

request {number1: 5, number2: 10}
response {additiontotal: 15}

在我的测试中,我想根据输入的内容进行断言即assert total == (number1 + number2)

最好的方法是什么?

1. You can store the request parameter in Customer properties.. 
2. Refer those values like ${#TestCase#number1} and ${#TestCase@number2} in the request.
3. You can write a groovy to read the value of both properties and sum and assert with response

注意:你可以在TestCase级别、TestSuite级别和Project级别存储属性。参考文献应作相应修改。

最新更新