Problems with xpath matching

Getting some XML back from a GET



Please, don’t blame me for the messed up namespace on productid, not my XML.

However if I do


it gives me an error when it does the implicit exists

However it should work fine. That xpath (not the one I want but I just want to get SOMETHING to work) works fine in Oxygen in XPath 1.0 and 2.0 modes.
As its so permissive.

Now, I can save the xml, e.g.


And can even print out as debug later on via exec(session=>session)

How would I write my own check predicate? i.e. take xml string, perform various of my own xpath tests, emit an error to gatling if I’m not happy.



Oh yes, using the latest Gatling

Gatling uses plain Java Xerces’ XPath, no custom stuff here.

Could you please provide a XML sample and XPath expression that look like your real world use case?
You can try an online XPath tester such as this one:

Also note that if you have namespaces in your XML, you have to pass them explicitly and also use them in your expression, like in the second sample here:

Also note that you’re using an old timestamped version (June, 28) while M3a has been released on July, 10. You’d better upgrade.



Works now that I’ve upgraded to 2.0.0.M3a

Did a .check(xpath("//organisation-id").saveAs(“organisation-id”)) , works lovely.


Great news!