How to use JMeter test concurrency

JMeter Download

1. Download the latest version of JMeter file compression package to a local

2, get the following extract from the folder

3, open the bin folder to find jmeter.properties file, open it

 4, line 37 to find modified (added) to the entry code modification Chinese

language=zh_CN

 5, jmeter.bat then locate the file, double-click to open

 6, the new test plan, select the "Test Plan" right click, select Add -> thread (user) -> Thread Group

   7, the cursor to select the thread group, right click, Add -> Sampler -> the HTTP request

  8, click http request to display the details page to fill the need for testing api URL and the need to pass along the value of the past, to note here that do not contain the URL http or https, the protocol can fill in this column, if it is http can be empty, the other is a request method, to determine the form of a post or get the form, as to the path and IP addresses can actually be written together, if there is a port number, then it would write separately to see more clearly. Parameters below is to be spliced ​​to the url parameters such as: http: //baidu.com name = summer & id = 888 such data?? Parameter that is passed to the back, click on the bottom Add button to add it to the parameter column.

9 move the cursor to the HTTP request -> Add -> configuration elements -> HTTP header information manager

 

10, add content requires the return of the token and Cookie, etc. on the Header information in the HTTP header Manager

11. After the completion of the content of the configuration work, we also need to see the configuration tool, move the cursor to the test plan -> Add -> Listener -> View results tree

12, see the results point to open the tree, we choose a xml file for storing test results

Here we are just fine with their own log4j2.xml

 

13, we return to the thread group, click here to select the number of concurrent (thread count) test, and concurrent time, as well as the number of cycles. Here refers to the number of concurrent users, i.e., how much simulated simultaneously, concurrently time refers to the user how much time these operations, such as operating within one minute, it can be set to 60, the number of cycles refers to a the operation needs to be performed many times.

14、设置完成后我们保存一下,然后先切换到查看结果树页面,然后点击上方的绿色启动按钮,即可开始并发测试了,返回的数值在察看结果树这边显示,我们点击响应数据即可看到返回的json数据了。

这样就完成了一个简单的并发测试了

附:如果是多个API是连贯操作,比如添加到购物车才能测下单,那么可以将这两个http请求挂在同一个线程组下面

 

Guess you like

Origin www.cnblogs.com/summerstore/p/11529105.html