Recently when using Web Images Jmeter automatically get the address, using the regular expression extractor, where three examples recorded by advanced use of regular expressions extractor. As a result your notes, and secondly also shared out for friends who need to use these functions reference.
Example I: Single Single template data
Definition Description:
Reference name: image represents the variable name, needless to say
Regular Expressions: Here's a pair of parentheses is a template, two pairs of brackets are two templates, ... ..
Template: Jmeter here to tell you which of template matching, which matches the first $ 1 $ a template (that is, the regular expression in the first parentheses)
Matching numbers: Tell Jmeter If more than one match to meet the requirements, which one you want? Here I filled -1 retrieves all matching data
- 0 represents random
- -1 means all
- 1 represents a
- 2 for the second
- ……
Default: no match to the default value of the data, needless to say.
Well, the regular expression definitions extractor has been completed, the following to see if you are using:
Instructions for use:
As we fill in the numbers 1 in the match, the match into a plurality of values, we can pass $ {variable name} _ coordinate the way to get:
- $ {Image_1} represents a match to the
- $ {Image_2} denotes a second matching to
- …..
Example II: multi-template single data
Definition Description:
Reference name: label represents a variable name, needless to say
Regular Expressions: Here's a pair of parentheses is a template, two pairs of brackets are two templates, we use two templates
Template: Jmeter here to tell you which of template matching, $ 1 $, $ 2 $ express matches both the first and the second template data
Matching numbers: here to fill in 1, to obtain data representing each template value of the first match
Default: no match to the default value of the data, needless to say.
Well, the regular expression definitions extractor has been completed, the following to see if you are using:
Instructions for use:
Because we use two templates (two pairs of parentheses), and told us to get Jmeter each template to match the data (matching numbers = 1), so you can get the following manner:
- $ {Label_g1} to obtain the first template matching data
- $ {Label_g2} to obtain the second template matching data
Example III: multiple templates, multiple data
This example is Example 1 and Example 2 in conjunction with using a plurality of templates, each matching a plurality of data. Then the way is acquired:
- $ {List_1_g1} obtaining a template of the first data $ {list_1_g2} acquiring first data of the second template
- $ {List_2_g1} acquiring second data of the first template $ {list_2_g2} acquiring second data of the second template