Class RegexExtractorWrapper

    • Method Detail

      • getGuiClass

        public java.lang.Class<?> getGuiClass()
        Description copied from interface: JMeterGUIWrapper
        Gui Test Class used by Jmeter TestElement.GUI_CLASS @See TestElement
        Specified by:
        getGuiClass in interface JMeterGUIWrapper<org.apache.jmeter.extractor.gui.RegexExtractorGui>
      • getTestClass

        public java.lang.Class<?> getTestClass()
        Description copied from interface: TestElementWrapper
        Test Class used by Jmeter TestElement.TEST_CLASS. @See TestElement.
        Specified by:
        getTestClass in interface TestElementWrapper<org.apache.jmeter.extractor.RegexExtractor>
      • getRefName

        public java.lang.String getRefName()
        The name of the JMeter variable in which to store the result. Also note that each group is stored as [refname]_g#, where [refname] is the string you entered as the reference name, and # is the group number, where group 0 is the entire match, group 1 is the match from the first set of parentheses, etc.
      • setRefName

        public void setRefName​(java.lang.String refName)
        The name of the JMeter variable in which to store the result. Also note that each group is stored as [refname]_g#, where [refname] is the string you entered as the reference name, and # is the group number, where group 0 is the entire match, group 1 is the match from the first set of parentheses, etc.
      • getRegex

        public java.lang.String getRegex()
        The regular expression used to parse the response data. This must contain at least one set of parentheses "()" to capture a portion of the string, unless using the group $0$. Do not enclose the expression in / / - unless of course you want to match these characters as well.
      • setRegex

        public void setRegex​(java.lang.String regex)
        The regular expression used to parse the response data. This must contain at least one set of parentheses "()" to capture a portion of the string, unless using the group $0$. Do not enclose the expression in / / - unless of course you want to match these characters as well.
      • getMatchNumber

        public java.lang.String getMatchNumber()
        Indicates which match to use. The regular expression may match multiple times.

        Use a value of zero to indicate JMeter should choose a match at random. A positive number N means to select the nth match. Negative numbers are used in conjunction with the ForEach Controller - see below.

      • setMatchNumber

        public void setMatchNumber​(java.lang.String matchNumber)
        Indicates which match to use. The regular expression may match multiple times.

        Use a value of zero to indicate JMeter should choose a match at random. A positive number N means to select the nth match. Negative numbers are used in conjunction with the ForEach Controller - see below.

      • isDefaultEmpty

        public boolean isDefaultEmpty()
        If true and Default Value is empty, then JMeter will set the variable to empty string instead of not setting it.
      • setDefaultEmpty

        public void setDefaultEmpty​(boolean defaultEmpty)
        If true and Default Value is empty, then JMeter will set the variable to empty string instead of not setting it.
      • getDefaultValue

        public java.lang.String getDefaultValue()
        If the regular expression does not match, then the reference variable will be set to the default value. This is particularly useful for debugging tests. If no default is provided, then it is difficult to tell whether the regular expression did not match, or the RE element was not processed or maybe the wrong variable is being used.

        However, if you have several test elements that set the same variable, you may wish to leave the variable unchanged if the expression does not match. In this case, remove the default value once debugging is complete.

      • setDefaultValue

        public void setDefaultValue​(java.lang.String defaultValue)
        If the regular expression does not match, then the reference variable will be set to the default value. This is particularly useful for debugging tests. If no default is provided, then it is difficult to tell whether the regular expression did not match, or the RE element was not processed or maybe the wrong variable is being used.

        However, if you have several test elements that set the same variable, you may wish to leave the variable unchanged if the expression does not match. In this case, remove the default value once debugging is complete.

      • getTemplate

        public java.lang.String getTemplate()
        The template used to create a string from the matches found. This is an arbitrary string with special elements to refer to groups within the regular expression. The syntax to refer to a group is: '$1$' to refer to group 1, '$2$' to refer to group 2, etc. $0$ refers to whatever the entire expression matches.
      • setTemplate

        public void setTemplate​(java.lang.String template)
        The template used to create a string from the matches found. This is an arbitrary string with special elements to refer to groups within the regular expression. The syntax to refer to a group is: '$1$' to refer to group 1, '$2$' to refer to group 2, etc. $0$ refers to whatever the entire expression matches.
      • getFieldToCheck

        public FieldToCheck getFieldToCheck()
        Field To check.
      • setFieldToCheck

        public void setFieldToCheck​(FieldToCheck fieldToCheck)
        Field To check.