(The regular expression extractor is one of the JMeter associations) usage scenarios:
There are two HTTP requests, and there is a field "ABCD" in the return data of request a, which is to be used as the entry for request B.
1. How to add
Request a right-to-back processor, regular expression extractor
2. Extract the corresponding value of Taskcode in Request a
To get to this value in the circle, configure the regular expression extractor:
Description
(1) Reference name: The name of the parameter to be referenced by the next request, such as filling in atask, you can use ${atask} to reference it.
(2) Regular expression:
(): The enclosed part is to be extracted.
.: Matches any string. +: one or more times.: Don't be greedy, stop after you find the first match.
(3) Template: Referenced by $$, if there are more than one regular expression in the regular expression, it can be $2$$3$ and so on, which represents the number of the parsed to the title. Example: $1$ represents the 1th value resolved to
(4) matching numbers: 0 for random values, 1 for all values, usually for 0
(5) Default value: If the parameter does not get the value, it defaults to a value let it take, I fill in the error.
3. Gets the value of the incoming B request
See if Request B passes the Atask value as expected
Citation successful ~ ~
Record a handy tool for testing regular expressions:
Tool Name: Regextester
How to use:
Interface test Tool-jmeter use Note (V: Regular expression extractor)