【发布时间】:2017-09-04 17:18:37
【问题描述】:
我对 SOAPUI 和自动化测试比较陌生:
我基本上是在尝试从一个 SOAPUI 响应中获取结果并将它们解析到另一个,这本身就很简单,但是我在第一个请求中有多个响应,需要解析并一个一个地运行它们到第二个。
请求一的响应:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://tempuri.org/IWebServices/GetListOfChangedCommunicationsResponse</a:Action>
</s:Header>
<s:Body>
<GetListOfChangedCommunicationsResponse xmlns="http://tempuri.org/">
<GetListOfChangedCommunicationsResult xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<b:long>8888633</b:long>
<b:long>8888635</b:long>
<b:long>8888637</b:long>
<b:long>8888641</b:long>
</GetListOfChangedCommunicationsResult>
<CommunicationsIssue xmlns:b="http://schemas.datacontract.org/2004/07/International.CD.Entity" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<b:DigiCommErrors i:nil="true"/>
<b:Errors/>
<b:Warnings i:nil="true"/>
</CommunicationsIssue>
</GetListOfChangedCommunicationsResponse>
</s:Body>
</s:Envelope>
I need to take those 4 responses <b:long> and pass them into this 2nd method 1 at a time replacing <tem:ReferenceNumber> each time as this method only allows individual requests
请求二:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
<soap:Header/>
<soap:Body>
<tem:GetCommunicationItem>
<!--Optional:-->
<tem:ReferenceNumber>${#TestCase#REF_ID}</tem:ReferenceNumber>
<!--Optional:-->
<!--tem:BarCode>?</tem:BarCode-->
</tem:GetCommunicationItem>
</soap:Body>
</soap:Envelope>
在 SOAPUI 中完成此任务的最佳过程是什么?
【问题讨论】:
-
您是否需要在以下请求中包含所有 4 个项目以及 4 个 ReferenceNumber 元素?
-
第一种方法中的 4 个
响应将用作第二种方法中 的输入。第二种方法只允许单个条目,所以我需要使用每个不同的响应运行/循环第二种方法 4 次。但并不总是 4 次迭代,第一次响应可能会产生或多或少的结果 -
在单个请求调用中(不是 4 次),对吧?
-
抱歉,我更新了最初的回复!
-
嗯,很抱歉,但回答您的问题 - 第二个请求需要运行 4 次(或有多少个响应),每次输入与第一个响应不同跨度>
标签: soapui