Excerpt from: https://www.cnblogs.com/imyalost/p/5804359.html
Project background: The company's end-H5 interface has newly developed the member registration function, need to carry on the pressure test to it
Project Objective: to withstand a minimum of 6000 pressure per minute
Note: Not every JMeter version will have the Soap/xml-rpc Request function
First, establish a test plan
As mentioned before, JMeter automatically generates an empty test plan when opened, and the user can build their own test plan based on the test plan.
A performance test load must have one thread group complete, and a test plan must have at least one thread group. The Add thread group operation is as follows:
Right-click at the test plan: Add →threads (Users) → Thread Group
Each test plan must contain at least one thread group, or, of course, multiple, multiple thread groups that run in JMeter in parallel, that is, initialized at the same time and execute the sampler under it simultaneously
The thread group consists of three main parameters:
Number of Threads: Number of virtual users, a thread or process
ramp-up Period (in seconds): preparation time. The number of threads to be set starts all the time, for example, the number of threads is 6000, the startup period is 60, then 6,000 threads need to be started within 60S;
Number of cycles: the number of times each thread sends a request. For example, 6,000 threads, each thread is sent 1 times, if checked forever, then it will always be sent down until the script is stopped;
Setting a reasonable number of threads can have a decisive impact on meeting the test target. In this example, if the number of threads is too small, the set requirements cannot be reached;
In addition, it is important to set a reasonable number of cycles, in addition to a given set number of cycles and forever, you can also check the scheduler , set the start and end time to control.
Second, add sampler
After adding the thread group, right-click on the Threads Group: Add →sampler→soap/xml-rpc Request (SOAP/XML-RPC: All different data formats in the message)
As mentioned earlier, a sampler (Sampler) is a unit that interacts with the server. A sampler typically works in three parts: sending a request to the server, recording the server's response data, and recording the corresponding time information
Here to explain, because H5 interface member registration, send to the end is an XML file, so here I choose the Sampler is SOAP/XML-RPC Request
In the diagram above, select the SOAP/XML-RPC request Sampler, and then enter the URL in the URL column where we need to pressurize
Then the default option, use KeepAlive, means: Keep the connection, this is a header field in the HTTP protocol message, and the previous essay on the HTTP protocol has written
The following SOAP/XML-RPC data input needs to be sent in the XML format of the file on the line (also can be imported into the XML file folder for reading), the following is the difference between XML and JSON:
After adding the sampler and the specific address parameters, the next step is to add the listener to get the test results
Third, add listeners
Right-click on the thread group to add the listener you need, usually the result tree and aggregated report
After the thread is added to the group for testing, and when the thread executes, the results of the request and response in the result tree (success or failure) can be used to analyze the success of our tests and to confirm whether we have achieved the expected results based on aggregated report results.
Iv. Brief analysis of aggregation report
Aggregate Report:JMeterA commonly used Listener, Chinese is translated as "aggregated report"
Label:Each JMeter element (for example, HTTP Request) has a name attribute, which shows the value of the Name property
#Samples:Indicates how many requests you have made in this test, and if you simulate 10 users, each user iterates 10 times, then this shows a 100
Average:Average response time--by default, the average response time for a single Request, and when Transaction Controller is used, the average response time can also be displayed in Transaction units
Median:The median, which is the response time of 50% users
90% Line:90% User Response Time
Note: For the meanings of 50% and 90% concurrent users, please refer to the following
Http://www.cnblogs.com/jackei/archive/2006/11/11/557972.html
Min:Minimum response time
Max:Maximum response time
error%:Number of requests with errors in this test/total number of requests
Throughput:Throughput--By default, indicates the number of requests completed per second (request per Second), and when Transaction Controller is used, it can also represent a similarLoadRunnerThe number of Transaction per Second
kb/sec:The amount of data received from the server side per second, equivalent to throughput/sec in LoadRunner
JMeter WebService Interface Test (SOAP/XML-RPC Request)