org.apache.jmeter.extractor
Class XPathExtractor
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.extractor.XPathExtractor
- All Implemented Interfaces:
- Cloneable, PostProcessor, Serializable, TestElement
- public class XPathExtractor
- extends AbstractTestElement
- implements PostProcessor, Serializable
Extracts text from (X)HTML response using XPath query language
Example XPath queries:
- /html/head/title
- extracts Title from HTML response
- //form[@name='countryForm']//select[@name='country']/option[text()='Czech Republic'])/@value
- extracts value attribute of option element that match text 'Czech Republic'
inside of select element with name attribute 'country' inside of
form with name attribute 'countryForm'
- See Also:
- Serialized Form
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement |
addProperty, addTestElement, canRemove, clear, clearTemporary, emptyTemporary, equals, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setName, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, threadFinished, threadStarted, traverse, traverseCollection, traverseMap, traverseProperty |
KEY_PREFIX
protected static final String KEY_PREFIX
- See Also:
- Constant Field Values
XPATH_QUERY
public static final String XPATH_QUERY
- See Also:
- Constant Field Values
REFNAME
public static final String REFNAME
- See Also:
- Constant Field Values
DEFAULT
public static final String DEFAULT
- See Also:
- Constant Field Values
TOLERANT
public static final String TOLERANT
- See Also:
- Constant Field Values
XPathExtractor
public XPathExtractor()
process
public void process()
- Do the job - extract value from (X)HTML response using XPath Query.
Return value as variable defined by REFNAME. Returns DEFAULT value
if not found.
- Specified by:
process
in interface PostProcessor
clone
public Object clone()
- Clone?
- Specified by:
clone
in interface TestElement
- Overrides:
clone
in class AbstractTestElement
setXPathQuery
public void setXPathQuery(String val)
getXPathQuery
public String getXPathQuery()
setRefName
public void setRefName(String refName)
getRefName
public String getRefName()
setDefaultValue
public void setDefaultValue(String val)
getDefaultValue
public String getDefaultValue()
setTolerant
public void setTolerant(boolean val)
isTolerant
public boolean isTolerant()
Copyright © 1998-2006 Apache Software Foundation. All Rights Reserved.