xpathjmeterextractor

JMeter -XPath2 Extractor not working as XPath


I tried to use JMeter recommendation to move to XPath2 over XPath Extractor

Since JMeter 5.0, you should use XPath2 Extractor as it provides better and easier namespace management, better performances and support for XPath 2.0

But for simple query I get no results, for output

<Object classId="QueryResultRow"><Property i:type="fn40:SingletonId" propertyId="Id"><Value>{abc-def}</Value></Property><Property i:type="fn40:SingletonString" propertyId="DCN"><Value>D112345</Value></Property></Object>

I use query /Object/Property/Value or //Object//Property//Value and it works only in XPath and not XPath2

Results:

Value={abc-def}
Value_1={abc-def}
Value_2=D112345
Value_matchNr=2

Same results with /*[local-name()='Object']/*[local-name()='Property']/*[local-name()='Value'] as @EdBangga suggested

Is there an issue with XPath2 Extractor or major change of syntax?


Solution

  • Your issue is due to namespaces in your XML (i)

    Once you show the full XML with namespaces I can give more information but to summarize: