pk786
pk786

Reputation: 2400

Property expansion in soapui returns only string not the expected value

I am trying to create a dynamic property during processing based on property expansion in soapui.

In the property, variable name is pkSSN and dynamic value is ${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

It should return the value in the ssn tag like '123456789' but it this [${createIP -abc#Response#//en:name/num/text()}].

I am following this link "https://www.soapui.org/scripting---properties/property-expansion.html#2-Dynamic-Properties" but still negative output. Can someone please suggest me what I am doing wrong here.

Upvotes: 0

Views: 282

Answers (1)

Gaurav Khurana
Gaurav Khurana

Reputation: 3936

enter image description here

i have created 2 request and it has below 2 request

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>

so the command

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

is able to retrieve what you are trying to achieve

i think you are missing the namespace

Upvotes: 1

Related Questions