JMeter is a tool, a very useful tool, for it we used to do stress testing, but also used to do automated testing, but when automated, we
We need to take into account the flow of the process and the sequential layout, so what should we do at this time?
We may be able to split the module with a controller, but sometimes in order to separate a module, I need to use a thread group to split, but the thread group and
What if the values of some parameters between thread groups need to be passed?
Ps:jmeter is independent of the thread group
For example, the token value returned by the login interface, where I used a post-mount with a front-mounted device, such as:
1.1, after landing to obtain the token value, (with regular expression to obtain the token value, according to debug can see token successfully obtained)
1.2. Add the Post processor BeanShell Postprocessor after the HTTP request, as shown in:
1.3. Write scripts in BeanShell postprocessor:
1.4, in the test plan with the addition of the predecessor processor BeanShell preprocessor, as shown:
1.5. Write the script in BeanShell preprocessor, as shown in:
1.6. Refer to the value of usertoken to see if it was successfully passed across thread groups
Request:
Result: For example, the value of Usertoken is successfully obtained:
PS: In order to let each thread group do not carry out the chaos execution please tick the test plan to run each thread group independently
Note: Each time sharing is only more convenient
JMeter cross-thread group transfer values