JMeter __XPath function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.
Also documented in context in the full Functions and Variables reference.
The XPath function reads an XML file and matches the XPath. Each time the function is called, the next match will be returned. At end of file, it will wrap around to the start. If no nodes matched, then the function will return the empty string, and a warning message will be written to the JMeter log file.
Example:
\${__XPath(/path/to/build.xml, //target/@name)}This will match all targets in build.xml and return the contents of the next name attribute
| Name | Required | Description |
|---|---|---|
| XML file to parse | Yes | a XML file to parse |
| XPath | Yes | a XPath expression to match nodes in the XML file |