What is the difference between user-defined variables and user parameters in Jmeter?

In a project of a tour guide platform, in the initial debugging script stage, I will need to hard-write some parameters in user-defined variables.

It's the thing in the picture below, pay attention to the timestamp parameter

After the script is debugged, perform concurrent debugging and find that the parameter value of each request, the timestamp is the same (discovered by development), that is, the timestamp when the script is initially started, and it will not change in the future.

In this way, in the later stage of operation, there will be a gap between the timestamp in jmeter and the server system time, and the system will fail to verify the timestamp.

So I checked the help of jmeter, found such a sentence, and immediately understood.

All data of a user-defined variable will only be initialized once, no matter how many threads you have and how many times you loop, its value will remain the same.

Immediately after Baidu's other controls, I found it! It is called User Parameter,

Right-click on the Sample to add a path:

PreProcessors -- User Parameters

After adding, as shown in the figure:

Re-debugging, when concurrent, the timestamp changes every time

In the same way, why the ${__CSVRead(,)} function always reads the first line of data, which has troubled me for a long time, is also solved.

Instead of only using the CSV Data Read component that comes with Jmeter to do the parameterization of the read file.

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324405945&siteId=291194637