Reputation: 13
Below is a sample response from JMeter tool.
<input name="requestId" type="hidden" value="-1859748216"/>
I try the following XPath //input[@name='requestId']
, but it doesn't work, I would like to take only the numeric value -1859748216
Upvotes: 1
Views: 1659
Reputation: 168227
If you really want to use XPath, you need something like //input[@name='requestId']/@value
However XPath Extractor is quite resource intensive as it keeps entire DOM in memory, when it comes to getting the values from HTML content I would rather recommend going for CSS Selector Extractor leaving XPath for XML or when CSS Selectors are not powerful enough
Example setup:
More information:
Upvotes: 0
Reputation: 58902
You need to get the value attribute using /@value
//input[@name='requestId']/@value
Prefer using newer/improved XPath2 Extractor over XPath Extractor
Upvotes: 1