dtoceva
12 years agoNew Contributor
SOAPUI Xpath Namespace issue
With Soap Ui Pro I need to perform web services testing:
I am sending request and from the received response I need to select proper value which is corresponding on several conditions. I am trying to take that value using Property Transfer and XPath.
My response is as follows:
<Response xmlns="http://xxxxx/xxx/xxx/Get">
<Log/>
<Messages/>
<Offers>
<e>
<Currencies>
<e>
<PayoutAmount>xxx</DevicePayoutAmount>
<DisplayName>xxxx</DisplayName>
<Id>xxxx</Id>
<IsDefault>xxxx</IsDefault>
</e>
</Currencies>
<DisplayName>DressUpPrincess</DisplayName>
<Id>5555</Id>
<ConversionType>1</ConversionType>
</e>
<e>
......(here I am receiving more offers)
</e>
</Offers>
I need to take the Id value 5555 from the offer where the Conversion Type is 1 (or the Display Name is DressUpPrincess).
I am using the following Xpath:
declare namespace ns1='http://xxxxx/xxx/xxx/Get';
//ns1:Response[1]/ns1:Offers[1]/ns1:e[1]/ns1:ConversionType[text()='1']/ns1:Id[1]/text()
but this is returning null.
What I am doing wrong?
Thanks, Diliana
I am sending request and from the received response I need to select proper value which is corresponding on several conditions. I am trying to take that value using Property Transfer and XPath.
My response is as follows:
<Response xmlns="http://xxxxx/xxx/xxx/Get">
<Log/>
<Messages/>
<Offers>
<e>
<Currencies>
<e>
<PayoutAmount>xxx</DevicePayoutAmount>
<DisplayName>xxxx</DisplayName>
<Id>xxxx</Id>
<IsDefault>xxxx</IsDefault>
</e>
</Currencies>
<DisplayName>DressUpPrincess</DisplayName>
<Id>5555</Id>
<ConversionType>1</ConversionType>
</e>
<e>
......(here I am receiving more offers)
</e>
</Offers>
I need to take the Id value 5555 from the offer where the Conversion Type is 1 (or the Display Name is DressUpPrincess).
I am using the following Xpath:
declare namespace ns1='http://xxxxx/xxx/xxx/Get';
//ns1:Response[1]/ns1:Offers[1]/ns1:e[1]/ns1:ConversionType[text()='1']/ns1:Id[1]/text()
but this is returning null.
What I am doing wrong?
Thanks, Diliana