Package org.apache.jmeter.extractor
Class HtmlExtractor
-
- All Implemented Interfaces:
-
java.io.Serializable,java.lang.Cloneable,org.apache.jmeter.gui.Searchable,org.apache.jmeter.processor.PostProcessor,org.apache.jmeter.testelement.TestElement
public class HtmlExtractor extends AbstractScopedTestElement implements PostProcessor, Serializable
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringEXTRACTOR_JSOUPpublic final static StringEXTRACTOR_JODDpublic final static StringDEFAULT_EXTRACTORpublic transient JMeterContextthreadContextpublic transient StringthreadNamepublic final static TestElement.CompanionCompanionpublic final static StringNAMEpublic final static StringGUI_CLASSpublic final static StringENABLEDpublic final static StringTEST_CLASSpublic final static StringCOMMENTS
-
Constructor Summary
Constructors Constructor Description HtmlExtractor()
-
Method Summary
Modifier and Type Method Description static Array<String>getImplementations()Get the possible extractor implementations voidprocess()Parses the response data using CSS/JQuery expressions and saving the results into variables for use later in the test. static ExtractorgetExtractorImpl(String impl)voidsetExtractor(String attribute)Set the extractor. StringgetExtractor()Get the name of the currently configured extractor voidsetAttribute(String attribute)StringgetAttribute()voidsetExpression(String regex)StringgetExpression()voidsetRefName(String refName)StringgetRefName()voidsetMatchNumber(int matchNumber)Set which Match to use. voidsetMatchNumber(String matchNumber)intgetMatchNumber()StringgetMatchNumberAsString()voidsetDefaultValue(String defaultValue)voidsetDefaultEmptyValue(boolean defaultEmptyValue)StringgetDefaultValue()Get the default value for the variable if no matches are found booleanisEmptyDefaultValue()-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse -
Methods inherited from class org.apache.jmeter.testelement.AbstractScopedTestElement
fetchScope, getProps, getSchema, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariable -
Methods inherited from class org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProps, getSchema, getString, removed, set -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getImplementations
static Array<String> getImplementations()
Get the possible extractor implementations
- Returns:
Array containing the names of the possible extractors.
-
process
void process()
Parses the response data using CSS/JQuery expressions and saving the results into variables for use later in the test.
-
getExtractorImpl
static Extractor getExtractorImpl(String impl)
- Parameters:
impl- Extractor implementation- Returns:
Extractor
-
setExtractor
void setExtractor(String attribute)
Set the extractor. Has to be one of the list that can be obtained by getImplementations
- Parameters:
attribute- The name of the extractor to be used
-
getExtractor
String getExtractor()
Get the name of the currently configured extractor
- Returns:
The name of the extractor currently used
-
setAttribute
void setAttribute(String attribute)
-
getAttribute
String getAttribute()
-
setExpression
void setExpression(String regex)
-
getExpression
String getExpression()
-
setRefName
void setRefName(String refName)
-
getRefName
String getRefName()
-
setMatchNumber
void setMatchNumber(int matchNumber)
Set which Match to use. This can be any positive number, indicating the exact match to use, or
0, which is interpreted as meaning random.- Parameters:
matchNumber- The number of the match to be used
-
setMatchNumber
void setMatchNumber(String matchNumber)
-
getMatchNumber
int getMatchNumber()
-
getMatchNumberAsString
String getMatchNumberAsString()
-
setDefaultValue
void setDefaultValue(String defaultValue)
- Parameters:
defaultValue- value of the variable if no matches are found
-
setDefaultEmptyValue
void setDefaultEmptyValue(boolean defaultEmptyValue)
- Parameters:
defaultEmptyValue- boolean set value to "" if not found
-
getDefaultValue
String getDefaultValue()
Get the default value for the variable if no matches are found
- Returns:
The default value for the variable
-
isEmptyDefaultValue
boolean isEmptyDefaultValue()
- Returns:
boolean set value to "" if not found
-
-
-
-