Forum Discussion

M_McDonald's avatar
M_McDonald
Super Contributor
16 years ago

Strange XPath Match message

See attached screenshot.

Values is dialog look identical, but when I cut and paste the text I see this:

    [tt:3cgx5py3]XPathContains comparison failed, expecting [ 11742087 ], actual was [11742087][/tt:3cgx5py3]

with leading and trailing spaces on the first value.

Also don't know why this match is failing, but continuing to work on that.

This is happening in recent 3.5 and current 3.5.1 builds

7 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    If I just use the bare text value, that works, but I wanted to have the surrounding element so I could use a wildcard as the value will be different every time.
  • Hi,

    hmm.. if you are not interested in the value, why not use a count(...) statement instead with an expected value of 1?

    anyhow, the error still needs investigating..

    regards,

    /Ole
    eviware.com
  • Hi again,

    can you attach the underlying message that you are asserting so we can try to reproduce?

    Thanks in advance!

    regards,

    /Ole
    eviware.com
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    OK, I think I see the issue here. This works if I include all the namespaces in the expected result, eg:

    <IdValue name="BackgroundCheckOrderNumber" xmlns:ns4="http://purl.org/dc/elements/1.1/" 
        xmlns:ns3="http://www.w3.org/2000/09/xmldsig#"
        xmlns:ns2="https://www.sterlingdirect.com/sif/ws/hrxml/Screening/1.0"
        xmlns="http://ns.hr-xml.org/2006-02-28"
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">11742100</IdValue>


    even though the actual XML response has

    <IdValue name="BackgroundCheckOrderNumber">11742100</IdValue>


    I would have thought that the match value could be constructed using the namespace prefix like this

    <ns1:IdValue name="BackgroundCheckOrderNumber">11742100</ns1:IdValue>


    but that gives me the mismatch error.