jmeter study, practice three parameters and associate ----

We realized on a simple test login interface, only one user request parameter name, to achieve a single-user login. If we want to simulate multiple users logged in, do not want to repeat the login interface to write many times, but each time the request parameter difference?

Here we should be the login interface to write once, to ensure that every one of the different parameters, you can achieve parametric

1. Right-mouse thread group: Add --- original configuration data file settings --CSV

2. Set file information

Name can be given free access, the file name is the directory where the file + file name, variable name can also be required to take under the Freedom of fixed

3.HTTP set the parameters of the interface request, $ parameter name in {} is the data csv file variable names, thus making a parameterized into a reference in the interface.

Second, the sign in the door play a role in the operation of the entire system, only entered the door, subsequent operations can proceed smoothly. The system being tested blogger login interfaces return the token, as the interface to the subsequent request headers required request parameters,

Therefore, we must obtain from the login interface in response to the token, as a follow-interface header in the token request. I am here using regular expressions to get the token

Right 1.HTTP request (i.e., login interface): Add - postprocessor - regular expression extractor

The login interface is the response shown:

It's not very complicated expressions, are generally '*' can get normal. The following regular expression, can be defined as the reference name token, other subsequent request headers of the request interface by $ {token} referenced

 2. associated token use

Use in the next HTTP request interface add header information manager, the request header to realize the association $ {token}

3. If the token is based on a subsequent plurality of interfaces operate after logon token, each of the interfaces are the same, but repeated in every HTTP request is added in the HTTP request header information manager that it is very complicated things.

Here it comes to hierarchical thinking, the public part of the group on the thread (xx system) directory, you can set the time to achieve public.

For example, bloggers here have to see the results of the tree, in response to the assertion, HTTP header information manager to see all the results on the table with thread group (xx system) following directory, enabling the public without each HTTP request in the repeat interface written.

Guess you like

Origin www.cnblogs.com/dll26/p/11230251.html