Poptest is the only training institute for developing Test and development engineers in China, aiming at the ability of the trainees to be competent in automated testing, performance testing and testing tools development. In Poptest that the tool is not a problem, jmeter or LoadRunner are tool-level, really improve the level of performance testing, or need to have a certain architectural knowledge, network knowledge, server knowledge, poptest through a large number of practical cases of the explanation to improve the actual experience of the students, Get started with performance testing as soon as possible. (You are interested in the course, please add qq:908821478)
1. Deployment of the program environment under test
For automated testing, especially this article would like to make a direct test by HTTP request, according to the general idea is to go through the login link, but this encountered the problem is: the construction of the cookie is more troublesome, performance testing additional init link. In fact through some simple transformation, it is possible to bypass login directly to send post requests to get results! 、
First: Modify the filter in Web. XML and comment out the filter for authentication permissions, as follows:
<filter> <filter-name>Filter</filter-name> <filter-class> Com.xxx.xxx.CheckFilter </filter-class> </filter> <filter-mapping> < Filter-name>filter</filter-name> <url-pattern>*.ajax</url-pattern>
</filter-mapping>
Second: Some of the code will do some validation of session permissions, such as the common one from the session to take out the user's id,post request, and then check whether the specific operation of the data belongs to the user. In this case, you can change the code as appropriate, such as writing a specific ID in code.
2. Case Preparation
First step: Create a new test plan
Step Two: Create a new thread group, where you configure the number of threads and the number of cycles, which means run 20*1=20 times
Step three: You can create more than one case in a thread group, such as:
Fourth Step: Configure the POST request
Fifth step: Add reports, such as aggregated reports
3. Execute under Linux
The JMeter execution mode under Linux supports script scheduling and can be extended to support mode for continuous integration. The JMeter version of Linux is consistent with Windows and has shell scripts to call! Dependent JDK is version 1.5!
Run jmeter.sh as follows:
Sh/home/work/jmeter24/bin/jmeter.sh-n-t AJAX_REQUEST_TEST.JMX
Performance Test Training: AJAX interface-level performance test version JMeter