Reprint: http://www.51testing.com/html/01/n-3725501.html
JMeter is a tool, a very useful tool, which we use to do the stress tests, can also be used for automated testing, but when it comes to automation we
We need to take into account the flow and sequential layout of the process, so what do we do at this time.
We may be able to split the module with the controller, but sometimes in order to separate a module, I need to use the thread group to split, but the thread group and
What to do if the values of some parameters between the thread groups need to be passed.
Ps:jmeter is independent of the thread groups
Example of the token value returned by the logged in interface, where I used a rear-end device in conjunction with a front, as shown in the following figure:
1.1, after landing to obtain the token value, (with regular expression to get to token value, according to the debugging can be seen token successful acquisition)
1.2. Add the Post processor BeanShell Postprocessor after the HTTP request, as shown in the following figure:
1.3. Write scripts in BeanShell postprocessor:
1.4. Add the front processor BeanShell preprocessor in the test plan, as shown in the following figure:
1.5, write the script in BeanShell preprocessor, as shown in the following illustration:
1.6, refer to the value of usertoken, to see if it was successfully passed across the thread group
Request:
Results: The value of Usertoken was successfully obtained as shown in the following figure:
PS: In order for each thread group to be free of clutter execution please tick the test plan to run each thread group independently