Jmeter regular extraction association

Jmeter regular extraction association

1. Add a regular extractor after the interface that needs to be extracted

Insert picture description here

2. Fill in the regular extractor

Reference name:
The name of the Jmeter variable, which stores the extracted result; that is, the value, field, and variable name to be quoted in the next request. The reference method in the following text is ${username}

Regular expression: (The method to test whether the desired data can be extracted is given below)
Use regular expressions to parse the response result, () brackets indicate part of the value in the extracted string, before and after the extracted boundary content

Template:
The extraction mode of regular expressions.
If the regular expression has multiple extraction results, the result is in the form of an array, template 1 11 2 2 2 and so on, which means assigning the parsed value to the variable; starting from 1, matching, and so on.
If there is only one result, it can only be1 11

Matching number:
The result of regular expression matching data can be regarded as an array, indicating how to take the value: 0 represents a random value, a positive number n represents the nth value (for example, 1 represents the first value), and a negative number Means to extract all qualified values.

Default value:
the default value when the match fails
Insert picture description here

3. Test whether the desired data can be extracted

Turn on the number of results,
turn on the response data,
switch the view mode,
this is the regular mode
Insert picture description here

Insert picture description here
Then write a regular expression to try to mention, by matching the number to select the required value
Insert picture description here

4. Use after extraction

Insert picture description here

Insert picture description here

Guess you like

Origin blog.csdn.net/aaaaaaaaanjjj/article/details/115003152