Jmeter parameterized settings, multi-user login

1. Simulate a multi-user login scenario

If the login mode is shown in the figure below, the login interface needs to enter: user name, password, verification code

Username and password are fixed values ​​and do not need to be processed. The verification code needs to be processed. It can be configured as a fixed value in the background. For details, you can ask for development consultation.

In this scenario, we use JMETER for parameterized settings to simulate multi-user login.

1. Prepare data, multiple usernames.

Create a new txt document, the data in it is "username, password, rencode" per line, separated by commas, and the commas should be in English format.

2. Use JMETER to open the recorded login content. If there are parameters in the parameters in the "http request" column in the recorded script, but the values ​​are fixed (as shown in the figure below),

3. Then now you want to make the value different every time, you can do the following:

On this step of the script, right-click to add--Configuration element--CVS data set config, as follows

4. Then click on the added cvs data and do the following configuration

Among them, filename is the location where the text.txt file is stored. Text.txt can be created as a text file first, and the data in it is "username, password, rencode" per line, separated by commas. That is, the data prepared in step 1.

The variable names can be set by yourself, as long as the back (the content after $ in the figure below) is consistent, and the others are set according to the above figure

5. Then change the parameter settings of the http request to the following settings

This means that each thread reads values ​​from ${username} and ${password}, ​​${rencode}, enabling different user access.

6. If the value of a parameter does not have a fixed value, it needs to be randomly selected, which can be represented by a random function, as shown in the following figure:

wares_num takes a random value of [1,10], so it can be represented by ${_Random(1,10)}, so that each thread obtains a random value between 1 and 10

Guess you like

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