Apache JMeter Configuration Steps

1. Installation environment :

 

JMeter can basically run on Window XP / 2003 / W7 / W8 , provided that the JDK package is installed, JMeter is a stress testing software developed based on JAVA . This configuration example is done on a W8-64 -bit system.

Installation package:

Ø Apache Jmeter 2.10   is the latest version until November 5 , 2013

Ø JDK version jdk-7u45-windows-x64 (pay attention to your own system version when downloading)

download link:

Jmeter 2.10:  

http://jmeter.apache.org/download_jmeter.cgi

JDK:         http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

                                            

two. installation steps:

 

The installation steps are not introduced, the JDK installation is the next step, and the next step is OK . JMeter does not need to be installed, the pressure package can be used after decompressing it.

three. Example environment:

 

Stress test target: ECSHOP mall

The purpose of the stress test: to test the server stress when 300 people log in to view comments at the same time in the ECHSOP mall

Stress test script design:

1.          Open the ECSHOP landing page

2.          Enter the account password to log in to ECSHOP

3.          Enter the user center

4.          View Reviews

5.          Exit the ECSHOP management platform

Expected effect of stress test: In your own test environment, the effect of stress test will not be explained, only the configuration steps will be explained.

 

Four. test steps

 

4.1 Script recording 

Script recording, JMeter enables WEB proxy, the browser sets the proxy Internet access to the IP address where JMeter is located , and your computer is the 127.0.0.1 proxy port by default 8080 . As for the browser to modify the proxy Internet server, no screenshots will be made.

Jmeter runs in the jmeter.dat file in the directory   \apache-jmeter-2.10\bin , double-click to open it to enter the Jmeter interface

 

 

Jmeter interface




Build a test plan without any configuration changes during the recording phase. You can change the name yourself

 

 

Add a Cookie Manager. This test requires a login operation. If there is no Cookie Manager, the HTTP request after login will not carry cookies when the script is running . You should know the consequences, that is, the request after successful login indicates that you are not logged in. Just add it without configuration.



Enable HTTP proxy server in workbench


 

Configure the target controller: select the test plan you just created, and select HttpClient4 as the Type . Then start.



Enter script recording, and operate ECHSOP once according to the preset test script process .

 

 

Login to ECSHOP




Enter the user management center

 

 

Open comment page




quit

 

 

After the above operations, the recording has been completed. In the recorded page, there may be other visits in it, and the unnecessary pages can be deleted




The request initiated by the browser is also recorded, which can be deleted.

 

 

Delete the pages that interfere with the test and save it




Fives. test verification script

After recording the script, run it once. Before running, add a listener to view the running status of the script. It is recommended to use the observation result tree listener to see the HTTP interaction back and forth.

 

 

run




运行完后通过结果树查看脚本运行结果,中间栏为脚本运行请求过的页面,都是绿色表示页面请求和响应都正常。再查看下关键页面的请求和响应参数,

登陆的请求正常,账号songmin密码123456 正常提交,看下响应数据

 

 

响应数据,看到有登陆成功的关键字。OK  脚本没问题,其他页面不去验证了,测试时,根据测试流程验证关键的几个页面请求和响应数据,是否和正常操作对应。




六.开始测试

6.1 添加报表

报表格式很多种,根据自己情况使用。不清楚的话,可以都添加运行一次后,看那个报表更合适

 



6.2 编辑测试压力数据

300并发,10秒中300并发准备完成,循环次数永远,持续时间300




运行脚本

300线程数已经完成启动

 

 

6.3 查看报表

图形报表

 

 

聚合报表,看到每个页面的响应时间,错误率,请求次数等。

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327018007&siteId=291194637