When using Jemeter to do stress testing, it is often necessary to parameterize the user name, password to reach multiple users using a different user name password to login. At this point we can use the CSV Data Set config to implement parameterized logins:
First, the test plan or thread group's add->config element->csv Data Set Config is added
The following is a brief description of each parameter of the CSV Data Set config:
- FileName: The name of the CSV file in the same directory
- File Encoding: Default is ANSI
- Varible Names: Defines the name of the parameter in the text file, separated by commas. After the script is referenced in the same way as the shell variable
- Allow quoated data: double quote Correlation
- Recycle on EOF: When set to True, allows the loop to be evaluated
- Stop thread on EOF: When recycle on EOF is false and stop thread on EOF is true, after reading the records in the CSV file, stop running
- Sharing Mode: Set whether thread sharing
Set 2 threads to run and the results are as follows:
The parameters in the CSV were read successfully.
Finally, we need to know that JMeter also has the following ways to Parameterize:
- User Defined varibles: Generally for parameters that do not need to be changed
- User Parameters:
- Through the system functions: Options->function Helper Dialog, through their own input parameter values, click the "Generate" button to generate
Ext: JMeter Using CSV data Set config for parameterized login