Jmeter- Building a Web test plan(2)

3. Adding Cookie Support

Nearly all web testing should use cookie support, unless your application specifically doesn't use cookies. To add cookie support, simply add an HTTP Cookie Manager to each Thread Group in your test plan. This will ensure that each thread gets its own cookies, but shared across all HTTP Request objects.

To add the HTTP Cookie Manager, simply select the Thread Group, and choose Add-->Config Element--> HTTP Cookie Manager, either from the Edit Menu, or from the right-click pop-up menu. 

4. Adding HTTP Requests

In our Test Plan, we need to make two HTTP requests. The first one is for the JMeter home page (http://jmeter.apache.org/), and the second one is for the Changes page (http://jmeter.apache.org/changes.html).

note: JMeter sends requests in the order that they appear in the tree. 

Start by adding the first HTTP Request to the JMeter Users element(Add-->Sampler-->HTTP Request). Then, select the HTTP Request element in the tree and edit the following properties.

  1) Change the Name field to "Home Page".

  2) Set the Path field to "/". Remember that you do not have to set the Server Name field because you already specified this value to the HTTP Request Defaults element.

Next, add the second HTTP Request and edit the following properties, see figure below.

  1) Change the Name field to "Changes".

  2) Set the Path field to "/changes.html". 

5. Adding a Listener to View Store the Test Results

The final element you need to add to your Test Plan is a Listener. This element is responsielbe for storing all of the results of your HTTP requests in a file and presenting a visual modle of the data.

Select the JMeter User element and add a Graph Results listener (Add -->Listener-->Graph Results). Next, you need to specify a directory and filename of the output file. You can either type it into the filename field, or select the Browse button and browse to a directory and then enter a file name. 

转载于:https://www.cnblogs.com/isister/p/4562141.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值