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