yogeshk
11 years agoNew Contributor
Unable to get xpath
Hi All,
I am new to SOAP UI automation and got stuck with an issue related to xpath.
From response xml i am unable to get the elements values using xpath. below is the response xml and i need to get the value of 'orderId' element.
I tried below from groovy script but not working.
context.expand('//orderId') and context.expand('//submitProductOrderOutput /orderId')
If the remove the content highlighted in below xml in bold then its working.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<submitProductOrderOutput xmlns:ns2="http://harlequins.bt.com/schema/CommonMessages" xmlns="http://harlequins.bt.com/schema/OUKMessages">
<responseStatus>
<ns2:responseStatus>SUCCESS</ns2:responseStatus>
<ns2:responseStatusCode>PROV100</ns2:responseStatusCode>
<ns2:responseStatusText>SUBMIT PRODUCT ORDER SUCCESS</ns2:responseStatusText>
</responseStatus>
<orderId>157642</orderId>
<orderValid>true</orderValid>
<customerId>41992</customerId>
<estimatedLeadTime>2014-08-21T00:00:00.000+01:00</estimatedLeadTime>
<appointmentReferences>027C10ST</appointmentReferences>
</submitProductOrderOutput>
</soap:Body>
</soap:Envelope>
I am new to SOAP UI automation and got stuck with an issue related to xpath.
From response xml i am unable to get the elements values using xpath. below is the response xml and i need to get the value of 'orderId' element.
I tried below from groovy script but not working.
context.expand('//orderId') and context.expand('//submitProductOrderOutput /orderId')
If the remove the content highlighted in below xml in bold then its working.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<submitProductOrderOutput xmlns:ns2="http://harlequins.bt.com/schema/CommonMessages" xmlns="http://harlequins.bt.com/schema/OUKMessages">
<responseStatus>
<ns2:responseStatus>SUCCESS</ns2:responseStatus>
<ns2:responseStatusCode>PROV100</ns2:responseStatusCode>
<ns2:responseStatusText>SUBMIT PRODUCT ORDER SUCCESS</ns2:responseStatusText>
</responseStatus>
<orderId>157642</orderId>
<orderValid>true</orderValid>
<customerId>41992</customerId>
<estimatedLeadTime>2014-08-21T00:00:00.000+01:00</estimatedLeadTime>
<appointmentReferences>027C10ST</appointmentReferences>
</submitProductOrderOutput>
</soap:Body>
</soap:Envelope>