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.
Scrapy xpath fail to find certain div in a webpage
Scrapy: Issues in dealing with Abbr tag in Xpath
XPath for ImportXML in Gsheet
XMLStarlet: selecting nodes using less than / greater than
Date range comparison in CQ using XPATH
I don't understand why this XPath expression is not working as a Scrapy selector
Selenium IDE, check (assert) if a dynamic element contains a specific text
xpath help to get buttons under a class where a link contains some href value
How to write xpath for below code displayed on Image
Fetch element child elements in XQuery
Quickly extract value using xpath
WSO2 ESB- Error Handling - On Error Sequence
Multiple xpath expressions
great ancestor & great great ancestor
How do I convert a string to an int variable in BizTalk XLANG?
extract table rows with XPATH