JMeter Cross-Threading group pass-value instance _ software test

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.