Most of the information is captured by the response information, such as session or hidden, etc.
To use the association in JMeter, the following 2 steps are divided:
Step 1. Add a regular expression to the sampler request, get information, add > Post processor > Regular expression extractor;
1.1 Most of us need to intercept some of the information, by looking at the source code, find the code we need, and then pass the regular processing, here's an example:
function is to extract the values from the Usersession
1.2 Sometimes we need to extract all the response information, and we can use the following:
Step2. Add postprocessers, select BeanShell Postprocessor, and proceed further
In BeanShell we can use Java code to process the contents of the regular extract, the general step is to receive the value of the regular expression extraction, if the value needs to be used as a parameter after sampler, we also want to save it as a variable, easy to call later.
Continue with the usersession in the first example to illustrate:
Since Post requires a session in the login URL, I save it as a variable session, the following is the call session value of the login URL
How to associate using BeanShell with JMeter