org.apache.jmeter.extractor

## Class HtmlExtractor

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.testelement.AbstractScopedTestElement
    - - org.apache.jmeter.extractor.HtmlExtractor

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Searchable, PostProcessor, TestElement

      public class HtmlExtractor
      extends AbstractScopedTestElement
      implements PostProcessor, java.io.Serializable

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_EXTRACTOR`
    `static java.lang.String` | `EXTRACTOR_JODD`
    `static java.lang.String` | `EXTRACTOR_JSOUP`

    - ### Fields inherited from interface org.apache.jmeter.testelement.TestElement

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HtmlExtractor()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getAttribute()`
    `java.lang.String` | `getDefaultValue()` Get the default value for the variable if no matches are found
    `java.lang.String` | `getExpression()`
    `java.lang.String` | `getExtractor()` Get the name of the currently configured extractor
    `static Extractor` | `getExtractorImpl(java.lang.String impl)`
    `static java.lang.String[]` | `getImplementations()` Get the possible extractor implementations
    `int` | `getMatchNumber()`
    `java.lang.String` | `getMatchNumberAsString()`
    `java.lang.String` | `getRefName()`
    `boolean` | `isEmptyDefaultValue()`
    `void` | `process()` Parses the response data using CSS/JQuery expressions and saving the results into variables for use later in the test.
    `void` | `setAttribute(java.lang.String attribute)`
    `void` | `setDefaultEmptyValue(boolean defaultEmptyValue)`
    `void` | `setDefaultValue(java.lang.String defaultValue)`
    `void` | `setExpression(java.lang.String regex)`
    `void` | `setExtractor(java.lang.String attribute)` Set the extractor.
    `void` | `setMatchNumber(int matchNumber)` Set which Match to use.
    `void` | `setMatchNumber(java.lang.String matchNumber)`
    `void` | `setRefName(java.lang.String refName)`

    - ### Methods inherited from class org.apache.jmeter.testelement.AbstractScopedTestElement

      `fetchScope, getSampleList, getScopeName, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariable`

    - ### Methods inherited from class org.apache.jmeter.testelement.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`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.testelement.TestElement

      `removed`

- - ### Field Detail

    - #### EXTRACTOR_JSOUP

          public static final java.lang.String EXTRACTOR_JSOUP

      See Also:
        Constant Field Values

    - #### EXTRACTOR_JODD

          public static final java.lang.String EXTRACTOR_JODD

      See Also:
        Constant Field Values

    - #### DEFAULT_EXTRACTOR

          public static final java.lang.String DEFAULT_EXTRACTOR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HtmlExtractor

          public HtmlExtractor()

  - ### Method Detail

    - #### getImplementations

          public static java.lang.String[] 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:
        `process` in interface `PostProcessor`
      See Also:
        `PostProcessor.process()`

    - #### getExtractorImpl

          public static Extractor getExtractorImpl(java.lang.String impl)

      Parameters:
        `impl` - Extractor implementation
      Returns:
        Extractor

    - #### setExtractor

          public void setExtractor(java.lang.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

          public java.lang.String getExtractor()

      Get the name of the currently configured extractor
      Returns:
        The name of the extractor currently used

    - #### setAttribute

          public void setAttribute(java.lang.String attribute)

    - #### getAttribute

          public java.lang.String getAttribute()

    - #### setExpression

          public void setExpression(java.lang.String regex)

    - #### getExpression

          public java.lang.String getExpression()

    - #### setRefName

          public void setRefName(java.lang.String refName)

    - #### getRefName

          public java.lang.String getRefName()

    - #### setMatchNumber

          public 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

          public void setMatchNumber(java.lang.String matchNumber)

    - #### getMatchNumber

          public int getMatchNumber()

    - #### getMatchNumberAsString

          public java.lang.String getMatchNumberAsString()

    - #### setDefaultValue

          public void setDefaultValue(java.lang.String defaultValue)

      Parameters:
        `defaultValue` - value of the variable if no matches are found

    - #### setDefaultEmptyValue

          public void setDefaultEmptyValue(boolean defaultEmptyValue)

      Parameters:
        `defaultEmptyValue` - boolean set value to "" if not found

    - #### getDefaultValue

          public java.lang.String getDefaultValue()

      Get the default value for the variable if no matches are found
      Returns:
        The default value for the variable

    - #### isEmptyDefaultValue

          public boolean isEmptyDefaultValue()

      Returns:
        boolean set value to "" if not found

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