JMeter-Building an Advanced Web Test Plan

1. Handling User Sessions With URL Rewriting

If your web application uses URL rewriting rather than cookies to save session information, then you‘ll need to do a bit of extra work to test your site.

To respond correctly to URL rewriting, JMeter needs to parse the HTML received from the server and retrieve the unique session ID. Use the appropriate HTTP URL Re-writing Modifier to accomplish this. Simply enter the name of your session ID parameter into the modifier, and it will find it and add it to each request. If the request already has a value, it will be replaced. If ‘Cache Session id?‘ is checked, then the last found session id will be saved, and will be used if the previous HTTP sample does not contain a session id.

URL Rewriting Example

Download this example. In Figure 1 is shown a test plan using URL rewriting. Note that the URL Re-writing modifier is added to the SimpleController, thus assuring that it will only affect requests under that SimpleController.

Figure 1 - Test Tree

In Figure 2, we see the URL Re-writing modifier GUI, which just has a field for the user to specify the name of the session ID parameter. There is also a checkbox for indicating that the session ID should be part of the path (separated by a ";"), rather than a request parameter

Figure 2 - Request parameters

2. Using a Header Manager

The HTTP Header Manager lets you customize what information JMeter sends in the HTTP request header. This header includes properties like "User-Agent","Pragma","Referer", etc.

The HTTP Header Manager, like the HTTP Cookie Manager, should probably be added at the Thread Group level, unless for some reason you wish to specify different headers for the different HTTP Request objectes in your test.

时间: 2024-10-01 02:42:12

JMeter-Building an Advanced Web Test Plan的相关文章

Jmeter- Building a Web test plan(1)

因为我接触的项目是Web的,所以优先从创建一个web test plan入手. 官方教程地址: http://jmeter.apache.org/usermanual/build-web-test-plan.html In this section, we will learn how to create a basic Test plan to test a web site. You will create five users that send requests to two pages

JMeter使用记录2 -- Web测试

Web测试用例 新建线程组,配置起3线程,循环1次,1秒启动所有线程,进行login,循环1个主要页面的读写,并对另外一个主要页面进行读操作,最后logout并在aggregate graph/graph resluts/view results tree查看测试结果. 1. 建立线程组,启动3个线程(1s起完),每个线程循环执行所有步骤1次,某个步骤出错也继续执行: 2. 创建http request defaults,把所有请求的default value定义在其中, web server

Building a RESTful Web Service(转)

Building a RESTful Web Service This guide walks you through the process of creating a "hello world" RESTful web service with Spring. What you’ll build You’ll build a service that will accept HTTP GET requests at: http://localhost:8080/greeting a

Lesson 2 Building your first web page: Part 3

Time to build your first HTML page by hand I could go on with more theory and send half of you to sleep (trust me); instead you are now going to actually build your very first web page! One of the best ways to learn something is to actually do it, so

Lesson 2 Building your first web page: Part 1

In this ‘hands-on’ module we will be building our first web page in no time. We just need to quickly cover a couple of points beforehand to help get our feet on the ground. The three ways you can build a web page 1. Use a pre-made template: WHAT IS A

三:搭建一个Web Test Plan

参考:http://jmeter.apache.org/usermanual/build-web-test-plan.html 场景 5个用户并发测试百度搜索,有两个请求,一个请求搜索"你好",一个请求搜索"helloworld". 配置用户 添加线程组. 在Test Plan 上右键,添加Thread Group. 设定如下:5个用户并发访问系统,1秒内准备好用户,每个用户访问循环2次. 添加配置元件 由于我们有多个相同的请求,所以我们可以直接添加一个HTTP 配

【jmeter】jMeter使用Badboy录制Web测试脚本

JMeter 是纯Java编写的软件功能和性.能测试工具,其录制脚本过于笨拙和复杂.而Badboy是用C++开发的动态应用测试工具,其拥有强大的屏幕录制和回放 功能,同时提供图形结果分析功能,刚好弥补了JMeter的不足之处.故此做Web测试使用这两个工具将是最佳组合.同时Badboy录制的脚本可导出为 JMeter支持的jmx格式脚本. 接下给大家分享:JMeter如何使用Badboy录制Web测试脚本? 工具/原料 Apache JMeter v2.12 Badboy v2.2 示例系统:w

Lesson 2 Building your first web page: Part 2

Tag Diagram You may have noticed that HTML tags come in pairs; HTML has both an opening tag (<tag name>) and a closing tag (</tag name>). The only difference between the opening and closing tags is that the closing tag contains an extra forwar

创建一个web Test Plan

1.添加ThreadGroup (1).线程组界面解析: 线程数:虚拟用户的个数 Ramp-up Period:开启每个用户的延迟时间,如果有5个虚拟用户,Ramp-up Period值是5,Jmeter将会在5分钟之内开启全部的用户,开启每个用户的延迟时间是:5 users/5 seconds=1 user per second;如果值是0,JMeter将会立刻开启你的所有用户 循环次数:表示Jmeter循环这个test多少次.