"JMeter" parameterization of user Defined variables and user Parameters

Source: Internet
Author: User

Accidentally found that there are two elements in the JMeter (user Defined variables and user Parameters) is very similar, at first I did not notice, the difference between the two. When you use it, you find that there are some differences between the two scenarios.

The same point: both are parameterized.

First, User Defined Variables

1, Add Method: Select "Thread Group", right click Add-config element-user Defined Variables, in this control, define the parameters you need, such as

2, use the method: in the corresponding need to use the location of parameters, using ${host} instead.

3, Application scenario : When the test environment changes, we only need to modify one IP to let the script immediately apply to another environment of the test, and do not need to be modified on a per-script basis.

Second, User Parameters

1, Add Method: Select "Thread Group", right click Add-pre processors-user Parameters, in this control, define the parameters you need, such as

2. Parameter explanation :

Update Once per iteration: Control parameter value change rule, if this option is selected, the value of the parameter remains constant in each iteration and a usable value is removed at the beginning of the new iteration; If this option is deselected, the value of the parameter is removed when a request is made to the sampler within each of its scopes.

3, use the method: in the corresponding need to use the location of parameters, using ${productid} instead.

Third, summary

1. The values of all parameters defined in User Defined Variables cannot be changed during the execution of test plan, since some parameters that do not need to be changed with the iteration in test plan (parameters that take only one value) are typically set here. For example, the host and port values of the application being tested.

2, if the parameters range is very small, using the user Parameters more appropriate.

3, if the parameters range is very large, it is recommended to use the CSV Data Set Config method, the method has greater flexibility.

"JMeter" parameterization of user Defined variables and user Parameters

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.