Forum Discussion

mlenosgrande's avatar
mlenosgrande
Contributor
15 years ago

Xpath bugs in free edition 3.5.1

Hi,
i want to point out a bug in xpath.
im using the sampleproject in the tutorials directory (sample-soapui-project.xml).
by the way,  the defintion of the wsdl inside is wrong : it is written :
definition="file:C:\Mogul\Projects\KvI Web Services\WSDL\sample.wsdl"

And i dont have any mogul directory. I think it is a directory of one of your developper using it locally.

Xpath bug
Sometimes you want to chek that the response match an other one without using 10 times some xpath like(exists..) for every node.
In the test Request logout of the Simple Search test Case, the response is :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:sam="http://www.example.org/sample/">
   <soapenv:Header/>
   <soapenv:Body>
      <sam:logoutResponse>
         <sessioninfo>OK</sessioninfo>
      </sam:logoutResponse>
   </soapenv:Body>
</soapenv:Envelope>


I want to add an assertion to verify that i get this response :
So i've added this xpath assertion : //*:logoutResponse
My excepted result is
    <sam:logoutResponse>
         <sessioninfo>OK</sessioninfo>
      </sam:logoutResponse>

I have try to declare namespaces, allow wilcard, ignore namspace prefixes.
I get this answer :
XPATHContains comparison failed, excepting[], actual was [
]

By the way,  the message error is not clear about the actual response so it is more difficult to debug.The actual response most of the tim is just some empty brackets ([  ]) An explicit actual response will help a lot.
No RepliesBe the first to reply