soapui中的属性扩展仅返回字符串而不是预期值

时间:2017-12-20 19:51:24

标签: soapui

我正在尝试在处理期间根据soapui中的属性扩展创建动态属性。

在属性中,变量名称为pkSSN,动态值为${createIP -abc#Response#//en:name/num/text()}

Where:
1. createIP -abc is test step name
2. Response (tag is present in the response of the  test step)
3. //en:name/num/text()   xpath of the value

它应该返回ssn标记中的值,如' 123456789'但这是[${createIP -abc#Response#//en:name/num/text()}].

我正在关注此链接" https://www.soapui.org/scripting---properties/property-expansion.html#2-Dynamic-Properties"但仍然是负面产出。有人可以告诉我这里我做错了什么。

1 个答案:

答案 0 :(得分:1)

enter image description here

我创建了2个请求,并且它有2个以下的请求

1)ConversionRate

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/">
<soapenv:Header/>
<soapenv:Body>
  <web:ConversionRate>
     <web:FromCurrency>DZD</web:FromCurrency>
     <web:ToCurrency>ALL</web:ToCurrency>
  </web:ConversionRate>
 </soapenv:Body>
</soapenv:Envelope>

2)SOAP Request second

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/">
 <soapenv:Header/>
 <soapenv:Body>
  <web:ConversionRate>
     <web:FromCurrency>USD</web:FromCurrency>
     <web:ToCurrency>${ConversionRate#Request#//web:ConversionRate[1]/web:FromCurrency[1]}</web:ToCurrency>
   </web:ConversionRate>
  </soapenv:Body>
</soapenv:Envelope>

所以命令

${ConversionRate#Request#//web:ConversionRate[1]/web:FromCurrency[1]}

能够检索您想要实现的目标

我认为你错过了命名空间