Apache JMeter
2.2

org.apache.jmeter.extractor
Class XPathExtractor

java.lang.Object
  extended byorg.apache.jmeter.testelement.AbstractTestElement
      extended byorg.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

Field Summary
static String DEFAULT
           
protected static String KEY_PREFIX
           
static String REFNAME
           
static String TOLERANT
           
static String XPATH_QUERY
           
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
XPathExtractor()
           
 
Method Summary
 Object clone()
          Clone?
 String getDefaultValue()
           
 String getRefName()
           
 String getXPathQuery()
           
 boolean isTolerant()
           
 void process()
          Do the job - extract value from (X)HTML response using XPath Query.
 void setDefaultValue(String val)
           
 void setRefName(String refName)
           
 void setTolerant(boolean val)
           
 void setXPathQuery(String val)
           
 
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
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

XPathExtractor

public XPathExtractor()
Method Detail

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()

Apache JMeter
2.2

Copyright © 1998-2006 Apache Software Foundation. All Rights Reserved.