考虑 SoapUI 中的动态响应断言
我被指派对 Web 服务进行自动化测试,以在soapUI 中实现以下目标:
基本上在每次发送soap 消息之前,都应该将其替换为另一个测试数据。例如,如果我有 10 个测试用例,那么下一个测试用例将覆盖前一个测试用例。测试用例 10 是我最终在屏幕上看到的。优点是您只需要一个肥皂请求消息,并且通过一个循环,肥皂消息会用新的测试数据(数据驱动)重新填充并发送。
我现在考虑的问题是,对于每个响应消息应用不同的断言。不可能对所有响应消息都有全局断言,因为每个响应消息看起来都不同,因此有必要对每个响应消息有特定的断言。问题是我无法保留特定响应消息的断言,因为它会被下一个响应消息重写。我最终在屏幕上看到的是测试用例 10 的响应消息。您遇到了问题
可能的解决方案:
- 单独保存每条响应消息。
- 分别获取每个响应消息并输入该特定响应的相应断言。
有没有人对上述内容有优雅的解决方案或经验并使其运行良好?
I have been assigned for automated testing of Web services to achieve the following in soapUI:
Basically before the soap message is send everytime it should be replaced with another test data. For example, if I have 10 test cases, then the next test case overwrites the previous one. Test Case 10 is what I finally see on the screen. The advantage is that you only need one soap request message and through a loop the soap message is refilled with the new test data(data driven) and sent.
The problem I consider now is that for each response message applies different assertions. It’s not possible to have global assertions for all response messages because every response message looks different and therefore it is necessary to have specific assertions for each response message. The problem is that I can’t hold the assertions for the specific response message because it’s then rewritten by the next response message. The response message by testcase 10 is what I finally see on the screen. You got the problem
A possible solution:
- Save each response message separately.
- Get each response message separately and enter the corresponding assertions for that specific respons.
Does anyone have an elegant solution or experience with the above and got it working well ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用数据源和数据循环来解决此问题。
在数据源中,包含您的输入值和断言。
然后,您只需将响应断言设置为指向数据源的变量即可。结构将如下所示:
You can solve this using a data source and data loop.
In the data source, have your input values AND your assertion.
Then, you just make the response assertion a variable pointing to the data source. Structure would then look like this: