Forum Discussion

ujas_doshi's avatar
ujas_doshi
Occasional Contributor
15 years ago

Xpath match not working

Hi,

I am trying to use xpath match. It is not working.


THis is the response.


<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:checkAuthorizationCompleteResponse xmlns:ns1="urn:wlp:cas:contract">
<return id="ac79b61f-a057-4179-8593-5dc4cc395826" xmlns="urn:wlp:cas:contract">
<statusCode>OK</statusCode>
<informationMessage>Checked</informationMessage>
<authorizationReference>210</authorizationReference>
<responseCode>ACCEPTED</responseCode>
</return>
</ns1:checkAuthorizationCompleteResponse>
</soap:Body>
</soap:Envelope>

FOr assertion, I am trying to use following Xpath query. (in Xpath expresssion window)

declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; //Obtained using 'Declare'
declare namespace ns1='urn:wlp:cas:contract'; //Obtained using 'Declare'
declare namespace ns11='urn:wlp:cas:contract'; //Obtained using 'Declare'


//ns1:checkAuthorizationCompleteResponse/return/statusCode

******************


After this, when I click on ,Select from current',

it gives the error "No match in current response"

(I am trying to attach a screenshot for more clarity)


THanks in advance for your help,
Ujas Doshi
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Seems you need the prefix on each element:

    [tt:1i56yr7h]//ns1:checkAuthorizationCompleteResponse/ns1:return/ns1:statusCode[/tt:1i56yr7h]
  • ujas_doshi's avatar
    ujas_doshi
    Occasional Contributor
    M McDonald wrote:
    Seems you need the prefix on each element:

    [tt:2pbcia3y]//ns1:checkAuthorizationCompleteResponse/ns1:return/ns1:statusCode[/tt:2pbcia3y]



    Hi McDonald,

    Thnaks a lot for your answer..
    But, unfortunately, after trying this, it is not working as well.

    It is giving the same error message, "No match in current respone"