Class HtmlExtractor
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.testelement.AbstractScopedTestElement
org.apache.jmeter.extractor.HtmlExtractor
- All Implemented Interfaces:
Serializable, Cloneable, Searchable, PostProcessor, TestElement
- See Also:
-
Field Summary
FieldsFields inherited from interface TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the default value for the variable if no matches are foundGet the name of the currently configured extractorstatic final ExtractorgetExtractorImpl(String impl) static String[]Get the possible extractor implementationsintvoidprocess()Parses the response data using CSS/JQuery expressions and saving the results into variables for use later in the test.voidsetAttribute(String attribute) voidsetDefaultValue(String defaultValue) Sets the value of the variable if no matches are foundvoidsetExpression(String regex) voidsetExtractor(String attribute) Set the extractor.voidsetMatchNumber(int matchNumber) Set which Match to use.voidsetMatchNumber(String matchNumber) voidsetRefName(String refName) Methods inherited from class AbstractScopedTestElement
fetchScope, getSampleList, getScopeName, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariableMethods inherited from class AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
-
Field Details
-
EXTRACTOR_JSOUP
- See Also:
-
EXTRACTOR_JODD
- See Also:
-
DEFAULT_EXTRACTOR
- See Also:
-
-
Constructor Details
-
HtmlExtractor
public HtmlExtractor()
-
-
Method Details
-
getImplementations
Get the possible extractor implementations- Returns:
- Array containing the names of the possible extractors.
-
process
public void process()Parses the response data using CSS/JQuery expressions and saving the results into variables for use later in the test.- Specified by:
processin interfacePostProcessor- See Also:
-
getExtractorImpl
-
setExtractor
Set the extractor. Has to be one of the list that can be obtained bygetImplementations()- Parameters:
attribute- The name of the extractor to be used
-
getExtractor
Get the name of the currently configured extractor- Returns:
- The name of the extractor currently used
-
setAttribute
-
getAttribute
-
setExpression
-
getExpression
-
setRefName
-
getRefName
-
setMatchNumber
public void setMatchNumber(int matchNumber) Set which Match to use. This can be any positive number, indicating the exact match to use, or0, which is interpreted as meaning random.- Parameters:
matchNumber- The number of the match to be used
-
setMatchNumber
-
getMatchNumber
public int getMatchNumber() -
getMatchNumberAsString
-
setDefaultValue
Sets the value of the variable if no matches are found- Parameters:
defaultValue- The default value for the variable
-
getDefaultValue
Get the default value for the variable if no matches are found- Returns:
- The default value for the variable
-