Package org.apache.jmeter.functions
Class XPath
java.lang.Object
org.apache.jmeter.functions.AbstractFunction
org.apache.jmeter.functions.XPath
- All Implemented Interfaces:
org.apache.jmeter.functions.Function
@AutoService(org.apache.jmeter.functions.Function.class)
public class XPath
extends org.apache.jmeter.functions.AbstractFunction
The function represented by this class allows data to be read from XML files.
Syntax is similar to the CVSRead function. The function allows the test to line-thru the nodes in the XML file - one node per each test, e.g. inserting the following in the test scripts:
${_XPath(c:/BOF/abcd.xml,/xpath/)} // match the (first) node
${_XPath(c:/BOF/abcd.xml,/xpath/)} // Go to next match of '/xpath/' expression
NOTE: A single instance of each different file/expression combination
is opened and used for all threads.- Since:
- 2.0.3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexecute
(org.apache.jmeter.samplers.SampleResult previousResult, org.apache.jmeter.samplers.Sampler currentSampler) void
setParameters
(Collection<org.apache.jmeter.engine.util.CompoundVariable> parameters) Methods inherited from class org.apache.jmeter.functions.AbstractFunction
addVariableValue, checkMinParameterCount, checkParameterCount, checkParameterCount, execute, getVariables
-
Constructor Details
-
XPath
public XPath()
-
-
Method Details
-
execute
public String execute(org.apache.jmeter.samplers.SampleResult previousResult, org.apache.jmeter.samplers.Sampler currentSampler) throws org.apache.jmeter.functions.InvalidVariableException - Specified by:
execute
in interfaceorg.apache.jmeter.functions.Function
- Specified by:
execute
in classorg.apache.jmeter.functions.AbstractFunction
- Throws:
org.apache.jmeter.functions.InvalidVariableException
-
getArgumentDesc
-
getReferenceKey
- Specified by:
getReferenceKey
in interfaceorg.apache.jmeter.functions.Function
- Specified by:
getReferenceKey
in classorg.apache.jmeter.functions.AbstractFunction
-
setParameters
public void setParameters(Collection<org.apache.jmeter.engine.util.CompoundVariable> parameters) throws org.apache.jmeter.functions.InvalidVariableException - Specified by:
setParameters
in interfaceorg.apache.jmeter.functions.Function
- Specified by:
setParameters
in classorg.apache.jmeter.functions.AbstractFunction
- Throws:
org.apache.jmeter.functions.InvalidVariableException
-