How can i get this value with XPATH in JMeter
I have a webservice response as such : <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Body> <FileResponse xmlns="http://xxx.x.sx.be"> <id>090150e080249d09</id> </FileResponse> </soap:Body> </soap:Envelope> I am trying to extract the value of "id" but i can't seem to figure out the right query. I used an online generator which provided : /soap:Envelope[#xmlns:soap="http://www.w3.org/2003/05/soap-envelope"]/soap:Body/FileResponse[#xmlns="http://xxx.x.sx.be"]/id/text() But it doesn't seem to work in Jmeter as the response is always null.
I found this to be the answer : //*[local-name() = 'id']
Your test for the namespace is invalid. Xpath queries do not support this. Instead you will need to JMeter to pass in the namespaces declarations along with the xpath query. I dont know how JMeter does that but I can give you an xpath expression that may work around it. //*[local-name()='FileResponse']/*[local-name()="id"]/text() The xpath will test the name of the node and ignoring the namespaces. Its not recomended practice to test without namespaces and could be slow but it'll work.
XQuery/XPath: Using count() and max() function for return of element with highest count
Double iteration over a nodeset in XSLT-1.0
What is the correct XPath query for 'select onchange'
XPath 2.0: Retrieving nodes by attribute where value is case Insensitive
XPath - abbreviation of position() function
XPath Query in JMeter
xpath expression to select attribute value
DOMDocument xpath query cut off time
How to parse the following html code get all text before “br” tag
XPath selector by class AND index
How to perform set operations in XPath 1.0
extract data from a div that have no class using xpath
Xpath: Select node but not specific child elements
XQuery - How to use eq (=) on a group of values
better selenium xpath is expecting
How to get only numbers from string with XPath