The difference between user parameters and user-defined variables in jmeter

  Anyone who has done parameterization with jmeter knows that there are many ways to parameterize, one of which is to use user-defined variables, and the other is to use user parameters. So, what are the similarities and differences between the two?

First, say the same point:

  1. All can be parameterized for the sampler to call.

  2. They are displayed in the form of key-values.

Second, let's talk about the difference. When we talk about this difference, we still use examples to make it easier to understand.

  1. In different components. User parameter locations belong to preprocessors, and user-defined variables belong to configuration elements.

  2. For user-defined variables, the data is initialized once; user parameters are changed every time. Let's take an example to see the difference between the two.

In the first step, we just look at the difference between the two parameters, so add Debug Sampler to the sampler

The second step is to add user parameters under Debug Sampler

 Add a random function, as shown in the figure

The third step, add user-defined variables

 Also add a random function

 The fourth step is to add the view result tree, and view the results after running. Note: r1 is defined via user parameters and r2 is defined via user defined variables.

Result 1, as shown in the figure:

Result 2, as shown in the figure:

Result 3, as shown in the figure

 In conclusion, when multiple threads are executed at a time, the variables defined by the user parameters are constantly changing, and a random number is regenerated each time, while the variables defined by the user are initialized once, and the parameter values ​​in each request are identical.

 

Guess you like

Origin blog.csdn.net/MXB1220/article/details/132280209