12. User-defined variables of Jmeter request components

1. Why are there custom variables?
First, let's take a look at how we are going to send multiple requests: the date value of each request is inconvenient to change, so we introduce user-defined variables to improve the reusability of the script. Insert picture description here
2. How to reference custom variables?
Refer to the variable in Jmeter like this: ${variable name}
3. How to add: Right-click the thread group-configuration element-user-defined variable
Insert picture description here
Fill in the corresponding value:
Insert picture description here
quote:
Insert picture description here
clear the previous result, click Start, run the test, and view the result
Insert picture description here
here We have successfully cited it.
So if we want to change the date in the request, we don't have to change the parameters in each request so much, just modify it directly in the user-defined variable. Here we just briefly introduce the usage of user-defined variables. There are many application scenarios. I will talk about it later in actual combat. I hope you will continue to pay attention!

Guess you like

Origin blog.csdn.net/weixin_45608577/article/details/108631123