【案例教程】LoadRunner订票系统WebTours部署

发布时间 2023-12-13 19:29:58作者: 小范爱随记

题目:

使用LoadRunner自带的测试项目--航班订票管理系统WebTours,网站地址为:http://127.0.0.1:1080/WebTours/ (用户名为jojo,密码为bean),完成性能测试,要求:

  • 1、 虚拟用户为10;

  • 2、 每隔15s启动2个Vusers;

  • 3、 运行时间为5min;

  • 4、 每隔15s停止2个Vusers;

  • 5、在分析工具中自定义一个图形。

LoadRunner相关的术语

Term Description
Scenario(场景) 定义测试阶段出现的事件,基于性能需求
Virtual Users or Vusers Vusers 模拟用户在你的系统上操作的动作。一个场景可以包含几十,上百,甚至上千的虚拟用户。
Vuser Script(脚本) 记录你的应用程序中执行业务流程的动作
Protocal 协议是客户端和服务器之间交流的方式
Transaction(事务) 你所定义的事务,用于测试你的系统性能。一个事务代表一个或多个终端用户的业务流程。一个事务允许你测试这些业务流程花费了多长时间。

LoadRunner负载测试的流程是什么?

  1. Plan the load test 计划负载测试
  2. Create Vuser scripts 创建脚本
  3. Define the scenario 定义场景
  4. Analyze the results 分析结果

案例步骤

一、录制脚本

1.启动Virtual User Generator

image
image

2、新建脚本和解决方案

image

3.选择Web-HTTP/HTML

image

4.创建好之后是这个样子的

image

二、开始录制

1.点击 Record>Record

image

2.填入URL地址

http://localhost:1080/WebTours
其他选项保持默认,但需要与我保持一致。
image
image

三、开始录制

image
image
image
此时已经开始录制了。

你需要进行以下动作:

1、用户名登录

1、Log on to HP Web Tours.
a.Type in the following information;
-User name:jojo
-Password:bean
b.On the left pane,click Login.Hp Web Tours Welcomes you to the application.
2、Enter the flight details.

2、进入航班详情

  • a.Click Flights.The Find Flight page opens.

  • b.From Departure City,select Denver(default).

  • c.Departure Date:Keep the default date.

  • d.From Arrival City,select** Los Angeles**.

  • e.Return Date:Keep the default date.

  • f.From Seating Preference,select Aisle.

  • g.Keep the rest of the default settings and click Continue.The Find Flight page opens.
    image

3、选择航班

image

4、进入订单详情

image

5、查看日程

image

6、停止录制

image

7、等待一会儿

image

四、查看脚本

1、步骤导航

image

五、重播脚本

image

1、设置迭代次数

image

2、设置步调

image

3、选择无代理

image

4、点击运行

image
image
脚本重播完成