add_xpath_extractor
Add an XPath extractor to an HTTP sampler to capture a value from an XML/HTML response into a JMeter variable, with optional tolerant parsing for real-world HTML.
Instructions
Add an XPath Extractor under an HTTP sampler, to save a value from an XML/HTML response into a variable using an XPath expression. Set tolerant=true for real-world (non-strict) HTML.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"planId": "<planId>",
"parentId": "<parentId>",
"referenceName": "<referenceName>",
"xpathQuery": "<xpathQuery>"
},
"name": "add_xpath_extractor"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | XPath Extractor | |
| planId | Yes | ||
| parentId | Yes | Id of the HTTP sampler node this extractor applies to | |
| tolerant | No | Use a lenient HTML parser instead of a strict XML parser | |
| xpathQuery | Yes | ||
| matchNumber | No | Which match to use (1 = first) | |
| defaultValue | No | NOT_FOUND | |
| referenceName | Yes | JMeter variable name to store the extracted value in |