JMeter cross-thread group transfer values

Source: Internet
Author: User

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

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.