LoadRunner性能测试实战教程
LoadRunner性能测试实例-3

LoadRunner性能测试实例3实例: LoadRunner创建运行场景在脚本录制完以后,就需要在控制台(Controller)运行这些脚本,通过运行Vuser产生实际的负载。
在控制台中就需要根据实际情况指定运行方案,监视性能指标。
创建方案要开始创建场景,请打开控制台并创建一个新的场景。
选择“开始”>“程序”>“LoadRunner”>“Controller”,打开控制台,显示“New Scenario”(新建方案)对话框,如图1所示。
图1 创建方案1.选择方案类型在方案选择中,有“手动方案”(Manual Scenario)或“面向目标的方案”(Goal-Oriented Scenario)两种类型供用户选择。
选择手动方案,则可以自行创建方案。
方法是定义要运行的Vuser组数并建立LoadRunner运行这些组的计划;也可以通过定义方案中要使用的Vuser的总数,并将占总数一定百分比的Vuser分配给每个脚本,从而创建手动方案。
选择面向目标的方案,则可以定义通过测试要实现的目标,LoadRunner将根据这些目标自动生成方案。
2.选择运行脚本在对话框左边的窗口(Available Scripts)中显示出录制好的脚本名称,选择好要运行的脚本后,单击“Add”按钮,此脚本便被添加到右边的窗口中,即被添加到控制台中。
如果要在下次新建方案时绕过该对话框,请清除“Show at startup”复选框。
生成方案后,也可以稍后再添加脚本。
单击“OK”按钮关闭该对话框,一个新的方案就建立完成了。
3.控制台窗口当一个新方案建立好后,就会进入控制台的方案设计的页面,有两个选项卡页面能进行相应配置,分别为“Design”(设计)和“Run”(运行)。
4.“Design”选项卡“Design”选项卡包括了“Scenario Schedule”(方案计划)窗格、“Scenario Groups”(方案组)窗格和右下角的一组功能按钮,如图2所示。
软件测试案例分析 实验二、Loadrunner基本操作

实验二 Loadrunner基本操作姓名:学号:一、实验目的(1)理解和掌握性能测试的基本原理和方法。
(2)掌握LR录制模式的选择与使用。
二、实验要求(1)运用LR录制登陆脚本,完成订票操作。
(2)回放脚本,观察结果。
(3)对脚本进行参数化。
三、实验内容(1)打开http://localhost/MercuryWebTours/订票页面,注册用户mike/mountain, jack/johnson,两个用户;(2)使用LR录制http://localhost/MercuryWebTours/订票页面的登录功能,对登录名和密码参数化,数据文件的数据如下:Username Passwordjojo beanjoe youngmike mountainjack johnson(3)将runtime settings中的run logic的循环次数设置为4;(4)将runtime settings中的log配置,选择extended log,且选中parameter substitution (5)回放脚本,在execution log中观察参数是否已经带入;(6)为登录就脚本设置一个事物,名称为”login transaction”(7)在实验报告中,记录每次的操作步骤及界面截图,保存execution log的执行日志。
四、实验结果:操作步骤及界面截图execution log的执行日志Virtual User Script startedStarting action vuser_init.Web Turbo Replay of LoadRunner 7.80.0 for WINXP; Web build 2271 [MsgId:MMSG-27143]Run-Time Settings file: "C:\Documents and Settings\Administrator\Local Settings\Temp\noname1\\default.cfg" [MsgId: MMSG-27141]Ending action vuser_init.Running Vuser...Starting iteration 1.Starting action Action.Action.c(7): Notify: Transaction login transaction started.Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/header.html" in "http://localhost/MercuryWebTours/" [MsgId: MMSG-26574]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/welcome.pl?signOff=true" in "http://localhost/MercuryWebTours/" [MsgId: MMSG-26574]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/banner_animated.gif" in HTML "http://localhost/MercuryWebTours/header.html" [MsgId: MMSG-26659]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?in=home" in "http://localhost/MercuryWebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/home.html" in "http://localhost/MercuryWebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(9): Found resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" in HTML "http://localhost/MercuryWebTours/home.html" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/sun_swede.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/login.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/signup.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/admin.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): web_url was successful, 51022 body bytes, 2171 header bytes [MsgId:MMSG-27176]Action.c(18): Submitting form to "http://localhost/MercuryWebTours/login.pl", Target Frame="body" [MsgId: MMSG-27978]Action.c(18): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" in "http://localhost/MercuryWebTours/login.pl" [MsgId: MMSG-26574]Action.c(18): Detected non-resource "http://localhost/MercuryWebTours/login.pl?intro=true" in "http://localhost/MercuryWebTours/login.pl" [MsgId: MMSG-26574]Action.c(18): Found resource "http://localhost/MercuryWebTours/images/sun_with_logo.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId:MMSG-26659]Action.c(18): Found resource "http://localhost/MercuryWebTours/images/flights.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/itinerary.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659]Action.c(18): Found resource "http://localhost/MercuryWebTours/images/in_home.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/signoff.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(18): web_submit_form was successful, 12483 body bytes, 1693 header bytes [MsgId: MMSG-27176]Action.c(27): Image-linking to "http://localhost/MercuryWebTours/welcome.pl?signOff=1", Target Frame="body" [MsgId: MMSG-27993]Action.c(27): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?in=home" in "http://localhost/MercuryWebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574] Action.c(27): Detected non-resource "http://localhost/MercuryWebTours/home.html" in "http://localhost/MercuryWebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574] Action.c(27): Resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/sun_swede.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/login.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/signup.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/admin.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): web_image was successful, 2366 body bytes, 698 header bytes [MsgId:MMSG-27176]Action.c(33): Notify: Transaction login transaction ended with Pass status (Duration: 1.3461). Ending action Action.Ending iteration 1.Starting iteration 2.Starting action Action.Action.c(7): Notify: Transaction login transaction started.Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/header.html" in "http://localhost/MercuryWebTours/" [MsgId: MMSG-26574]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/welcome.pl?signOff=true" in "http://localhost/MercuryWebTours/" [MsgId: MMSG-26574]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/banner_animated.gif" in HTML "http://localhost/MercuryWebTours/header.html" [MsgId: MMSG-26659]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?in=home" in "http://localhost/MercuryWebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/home.html" in "http://localhost/MercuryWebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(9): Found resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" in HTML "http://localhost/MercuryWebTours/home.html" [MsgId: MMSG-26659]"http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/login.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/signup.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/admin.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): web_url was successful, 51018 body bytes, 2171 header bytes [MsgId:MMSG-27176]Action.c(18): Submitting form to "http://localhost/MercuryWebTours/login.pl", Target Frame="body" [MsgId: MMSG-27978]Action.c(18): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" in "http://localhost/MercuryWebTours/login.pl" [MsgId: MMSG-26574]Action.c(18): Detected non-resource "http://localhost/MercuryWebTours/login.pl?intro=true" in "http://localhost/MercuryWebTours/login.pl" [MsgId: MMSG-26574]Action.c(18): Found resource "http://localhost/MercuryWebTours/images/sun_with_logo.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId:MMSG-26659]Action.c(18): Found resource "http://localhost/MercuryWebTours/images/flights.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/itinerary.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/in_home.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/signoff.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(18): web_submit_form was successful, 12482 body bytes, 1688 header bytes [MsgId: MMSG-27176]Action.c(27): Image-linking to "http://localhost/MercuryWebTours/welcome.pl?signOff=1", Target Frame="body" [MsgId: MMSG-27993]Action.c(27): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?in=home" in "http://localhost/MercuryWebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574] Action.c(27): Detected non-resource "http://localhost/MercuryWebTours/home.html" in "http://localhost/MercuryWebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574] Action.c(27): Resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/sun_swede.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/login.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/admin.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): web_image was successful, 2367 body bytes, 698 header bytes [MsgId:MMSG-27176]Action.c(33): Notify: Transaction login transaction ended with Pass status (Duration: 1.3192). Ending action Action.Ending iteration 2.Starting iteration 3.Starting action Action.Action.c(7): Notify: Transaction login transaction started.Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/header.html" in "http://localhost/MercuryWebTours/" [MsgId: MMSG-26574]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/welcome.pl?signOff=true" in "http://localhost/MercuryWebTours/" [MsgId: MMSG-26574]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/banner_animated.gif" in HTML "http://localhost/MercuryWebTours/header.html" [MsgId: MMSG-26659]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?in=home" in "http://localhost/MercuryWebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/home.html" in "http://localhost/MercuryWebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(9): Found resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" in HTML "http://localhost/MercuryWebTours/home.html" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/sun_swede.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/login.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/signup.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/admin.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): web_url was successful, 51021 body bytes, 2171 header bytes [MsgId:MMSG-27176]Action.c(18): Submitting form to "http://localhost/MercuryWebTours/login.pl", Target Frame="body" [MsgId: MMSG-27978]Action.c(18): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" in "http://localhost/MercuryWebTours/login.pl" [MsgId: MMSG-26574]Action.c(18): Detected non-resource "http://localhost/MercuryWebTours/login.pl?intro=true" in "http://localhost/MercuryWebTours/login.pl" [MsgId: MMSG-26574]Action.c(18): Found resource "http://localhost/MercuryWebTours/images/sun_with_logo.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId:MMSG-26659]"http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/itinerary.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/in_home.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/signoff.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(18): web_submit_form was successful, 12483 body bytes, 1635 header bytes [MsgId: MMSG-27176]Action.c(27): Image-linking to "http://localhost/MercuryWebTours/welcome.pl?signOff=1", Target Frame="body" [MsgId: MMSG-27993]Action.c(27): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?in=home" in "http://localhost/MercuryWebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574] Action.c(27): Detected non-resource "http://localhost/MercuryWebTours/home.html" in "http://localhost/MercuryWebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574] Action.c(27): Resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/sun_swede.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/login.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/signup.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/admin.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): web_image was successful, 2367 body bytes, 698 header bytes [MsgId:MMSG-27176]Action.c(33): Notify: Transaction login transaction ended with Pass status (Duration: 1.3043). Ending action Action.Ending iteration 3.Starting iteration 4.Starting action Action.Action.c(7): Notify: Transaction login transaction started.Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/header.html" in "http://localhost/MercuryWebTours/" [MsgId: MMSG-26574]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/welcome.pl?signOff=true" in "http://localhost/MercuryWebTours/" [MsgId: MMSG-26574]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/banner_animated.gif" in HTML "http://localhost/MercuryWebTours/header.html" [MsgId: MMSG-26659]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?in=home" in "http://localhost/MercuryWebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574]Action.c(9): Detected non-resource "http://localhost/MercuryWebTours/home.html" in "http://localhost/MercuryWebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(9): Found resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" in HTML "http://localhost/MercuryWebTours/home.html" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/sun_swede.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/login.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/signup.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): Found resource "http://localhost/MercuryWebTours/images/admin.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?in=home" [MsgId: MMSG-26659]Action.c(9): web_url was successful, 51013 body bytes, 2171 header bytes [MsgId:MMSG-27176]Action.c(18): Submitting form to "http://localhost/MercuryWebTours/login.pl", Target Frame="body" [MsgId: MMSG-27978]Action.c(18): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" in "http://localhost/MercuryWebTours/login.pl" [MsgId: MMSG-26574]Action.c(18): Detected non-resource "http://localhost/MercuryWebTours/login.pl?intro=true" in "http://localhost/MercuryWebTours/login.pl" [MsgId: MMSG-26574]Action.c(18): Found resource "http://localhost/MercuryWebTours/images/sun_with_logo.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId:MMSG-26659]Action.c(18): Found resource "http://localhost/MercuryWebTours/images/flights.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/itinerary.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/in_home.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Found resource "http://localhost/MercuryWebTours/images/signoff.gif" in HTML "http://localhost/MercuryWebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(18): Resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(18): web_submit_form was successful, 12483 body bytes, 1636 header bytes [MsgId: MMSG-27176]Action.c(27): Image-linking to "http://localhost/MercuryWebTours/welcome.pl?signOff=1", Target Frame="body" [MsgId: MMSG-27993]Action.c(27): Detected non-resource "http://localhost/MercuryWebTours/nav.pl?in=home" in "http://localhost/MercuryWebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574] Action.c(27): Detected non-resource "http://localhost/MercuryWebTours/home.html" in "http://localhost/MercuryWebTours/welcome.pl?signOff=1" [MsgId: MMSG-26574] Action.c(27): Resource "http://localhost/MercuryWebTours/images/banner_merctur.jpg" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/sun_swede.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/login.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/signup.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): Resource "http://localhost/MercuryWebTours/images/admin.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655]Action.c(27): web_image was successful, 2359 body bytes, 698 header bytes [MsgId:MMSG-27176]Action.c(33): Notify: Transaction login transaction ended with Pass status (Duration: 1.4922). Ending action Action.Ending iteration 4.Ending Vuser...Starting action vuser_end.Ending action vuser_end.Vuser Terminated.。
实验2 使用LoadRunner进行性能测试实验

使用LoadRunner进行性能测试LoadRunner是Mercury Interaction公司开发一款成熟的性能测试工具,LoadRunner作为性能测试的实现者,涉及性能测试流程、性能测试技术和软件体系架构等众多方面的知识点 。
性能测试的基准大体有以下几方面:—响应时间从应用系统发出请求开始,到客户端接收到最后一个字节数据为止所消耗的时间。
合理的响应时间取决于实际的用户需求。
—并发用户数一般是指同一时间段内访问系统的用户数量。
—吞吐量指单位时间内系统处理的客户请求数量。
—性能计数器描述服务器或操作系统性能的一些数据指标,比如Windows系统资源管理器。
--------------------------------------------------------------------------------------------------------------------------------本次实验课是针对LoadRunner(以下简称LR)的使用,我们将采用LR自带的HP WEBTours 应用程序来进行熟悉。
1.启动示例程序在开始程序中启动LoadRunneràsamplesàWebà启动Web服务器,如下图启动后在屏幕右下角会出现如下标识 : 。
2.启动Web Tours示例程序:在浏览器中点击下图中的Sign up now,进行注册多个账户,过程比较简单这里不再介绍.注册完成后,可以订一张机票,熟悉一下这个应用程序的相关操作,为下一步录制脚本做准备。
3. 传统手工性能测试中会有一个组织者演示要测试的整个过程给参予者,然后组织者会要求这些参予者在自己的机器上共同执行刚刚的过程,然后收集相关的数据再进行分析,性能是否达到了相关的标准.自动化测试过程中 :整个过程-------------------- Virtual User Generator录制脚本 组织者---------------------- Controller参予者自己的机器------------------ Loadgenerator 场景分析--------------------------------------Analysis下面我们一步步来进行首先启动Virtual User Generator,如下图启动后出现如下界面,在其中新建一个场景:在弹出的对话框中选定,点击在弹出的对话框中输入以下参数后点击OK:出现如下提示框后,开始录制脚本,此时会弹出IE,然后自动进入到WEB TOURS网站,用刚刚注册的信息进行登录,登录成功后,再定一张票,定票后,输入信用卡信息,然后退出登录,完成后,点击停止录制,此过程较为简单,这里不做说明录制完成后,在下图中点停止,脚本录制完成:稍待一会生成脚本,如下图所示:点击播放按钮,回放一下看有没有问题,回放有两种方式,一种是普通脚本回放,回放时运行到哪一行了,会有箭头指示,另外一种就是回放可以查看回放过程中的页面,方式如下:选择在弹出的对话中选择如下:再次回放就可以看到效果.加入事务:事务就是将整个录制过程分为几部分,比如这个例子中可以分登录,定票两个过程,在测试时就可以查看这两个过程分别的运行效率,从而确定,在整个定票过程中哪一个环节影响了性能。
LoadRunner性能测试过程

二、脚本 --检查点
为什么要加入检查点 检查点是检查脚本运行后,是否真的得到了预期结果。 因为曾经发现场景运行后,LR反馈事务运行成功,但其 实没有真正运行成功,工单没有流转。虽然我们可以在数 据库中查询工单的状态,但插入检查点后,在场景运行的 过程中就可以看到事务运行是否出现了问题,比在数据库 中看更加方便;另外,像测试查询的性能类的脚本,在数 据库中是看不到变化的,所以插入检查点就是非常必要的 了。
上面这段代码要加在查询后面,因为查询之后才能看到结果。场景运行 过程中,如果待回单标识只找到一次,就会有错误在场景执行界面报出 来,由lr_error_message实现。
二、脚本 --检查点
调试脚本,验证检查点是否起作用 至少要用一个验证反例来验证检查点是否真的有效。 比如,更改验证的字符串标识为“待接单”,运行场景查 询同样的待回单工单出来,看是否报错; ■如果不报错,说明检查点没起作用,要检查加入的检查点 位置是否正确,语句是否正确,或改用其他检查方式来设 检查点; ■如果反馈报错信息“找到1次,操作没成功!”说明检查 点设置生效了,可以继续往下做。
另:svr_pub_da_dispqueue派工工单处理表,也就是子单的一些信息 svr_pub_da_mainqueue工单主表,也就是主单的信息,张主单包含多张子单
二、脚本 --参数化
参数化 1.建立参数化文件*.dat,放入脚本文件夹内 2.在PLSQL中根据sql语句查询出所得的数据, 拷贝到参数化文件内 3.在脚本中找到要参数化的字段,对其进行 参数化,引用参数化文件中的数据
三、场景
--场景分类
场景模式的选择
场景分为手工场景和面向目标的场景。 ◆手工场景要达到某个测试目的需要根据场景每次运行的结果,需要使 用者自己调整虚拟用户数,直到达到预期目标。 ◆面向目标场景是在场景运行前设置了目标值,LR在运行的过程中自动 逐步加载虚拟用户以达到预设的目标。 目前我们用的都是手工场景,面向目标的场景还没有仔细研究过,但 前不久我试验了一下,手工场景和面向对象场景得出的结果差别还比 较大,现在还不知道具体原因,待以后解决。
LoadRunner测试步骤详细步骤

LoadRunner测试步骤详细步骤录制测试脚本1).点击主界面2).点选新建协议3).在协议框中选择全部,选择新的协议Web测试一般选择(Web (HTTP/HTML))如果别的项目可根据与程序员交流程序间通讯的协议,在这里做选择就可以了4).填写你要测试的URL地址点击oK 后进行脚本录入1. 脚本的回放1).在这里可以对脚本进行参数化、集合点、事务等都可以在这里对脚本进行设置当脚本中回放时没有错误,就可一保存脚本,进行后面的压力测试了负载加压测试1).选择负载测试2.选择相对应的测试脚本手动场景可以设置不同的业务组用户数量,同时编辑计划指定相关的运行时刻,虚拟用户加载策略等完成场景的设计工作3).在这里进行场景设置4).虚拟用户数量及加载方式设置5)开始加载测试6)添加相应的监控指标7)添加Windows Resources 的监控1.双击 1图中的windowsResources2.在2图的空白处右击选择菜单中的Add..3.在3图中点击Add 后出现图44.在4图中输入要检测的见算计的IP 后点击 OK5.在图5中点击Add 选择你要检测的数据项后点击 Add 然后点击Close6.后点击图5的OK 就出现我们想要的监视图68)添加SQL Server 资源的监控在这里与添加WindowsResources步骤基本相同,只要注意几点1. 保证打开服务的远程服务(Remote Registry Service)打开,本地计算机加入了服务器域2. 要经过防火墙来监控Windows NT或 Windows 2000,应使用TCP,端口 139。
Loadrunner实战教程第2章

2.10 系统性能调优
系统调优由易到难的先后顺序如下:
硬件问题; 网络问题; 应用服务器、数据库等配置问题; 源代码、数据库脚本问题; 系统构架问题。
2.11 性能测试总结
性能测试工作完成以后,需要编写性能测试总结报告。
系统性能调优
性能测试总结
2.2 性能测试需求分析
性能测试的目的就是把客户的真正需求搞清楚,
这是性能测试最关键的过程。
典型问题
我们需要贵单位对所有的功能都进行性能测试;
系统用户登录响应时间小于3秒钟;
系统支持10万用户并发访问。
2.3 性能测试计划
性能测试计划是性能测试的重要过程。在对客
软件性能测试与LoadRunner实战教程
第2章 性能测试过程概述
2.1 性能测试的基本过程 2.2 性能测试需求分析 2.3 性能测试计划 2.4 性能测试用例 2.5 测试脚本编写 2.6 测试场景设计 2.7 测试场景运行 2.8 场景运行监控 2.9 运行结果分析 2.10 ห้องสมุดไป่ตู้统性能调优 2.11 性能测试总结
2.10 系统性能调优
性能测试分析人员经过对结果的分析以后,有可能提出
系统存在性能瓶颈。这时相关开发人员、数据库管理员 、系统管理员、网络管理员等就需要根据性能测试分析 人员提出的意见同性能分析人员共同分析确定更细节的 内容,相关人员对系统进行调整以后,性能测试人员继
续进行第二轮、第三轮……的测试,与以前的测试结果
2.8 场景运行监控
场景的监控需要注意:
负载机的时钟要一致,保证在监控过程中的数据是同步 的; 尽量搜集与系统测试目标相关信息,无关内容不必进行 监控;
软件测试实验5 使用LoadRunner进行完整性能测试
实验5《使用LoadRunner进行完整性能测试》实验学时: 2每组人数: 1实验类型: 1 (1:基础性2:综合性3:设计性4:研究性)实验要求: 1 (1:必修2:选修3:其它)实验类别: 3 (1:基础2:专业基础3:专业4:其它)一、实验目标1.掌握LoadRunner参数化输入、插入事务、插入集合点等基本操作。
2.进一步掌握LoadRunner的扩展功能和使用;3.设计脚本录制,运行脚本,查看运行结果,进行分析。
二、实验内容2.1录制飞机订票系统的登录功能,对脚本进行参数化输入,并创建和运行场景,查看测试结果,进行分析。
2.2 录制飞机订票系统的订票并查询功能,对脚本插入事务、插入集合点,修改思考时间,并创建和运行场景,查看测试结果,进行分析。
2.3 考虑系统如下场景,首先注册一个唯一的用户,并且以注册用户登录到系统,进行飞机订票后查询操作,可联合2.1和2.2所保存的两个脚本,创建和运行场景,查看测试结果,进行分析。
三、实验要求1. 掌握Loa dRunner完善测试脚本的基本内容,包括参数化输入、插入事务、插入集合点、插入注释。
2. 掌握利用LoadRunner进行完整分析的过程。
四、实验步骤1.实验内容2.1。
录制飞机订票系统的登录功能,对脚本进行参数化输入,并创建和运行场景,查看测试结果,进行分析。
步骤一:同实验4的录制方式,录制飞机订票系统的注册功能。
注册1个新帐户(例如为user1(password1))退出停止录制。
步骤二:VUGen中查看录制生成的Script,选中要参数化的内容(首先对username进行参数化, password….and go on)。
可右键---【Replace with a new parameter】或菜单【insert】----【new Parameter…】。
步骤三:后对password参数化,建立参数化之间的关联。
如果用户名和密码不是一一对应关系,每次运行脚本时取的用户名和密码不能对应会出问题。
LoadRunner性能测试详细操作演示过程资料
LoadRunner性能测试演示过程目录1.LoadRunner11基础 (2)1.1术语 (3)1.2组件与测试流程 (3)2.测试计划 (4)2.1测试环境 (4)2.2应用程序要求 (4)2.3测试人员和时间 (5)3使用LoadRunner进行负载/压力测试 (5)3.1录制基本的用户脚本 (5)3.2 完善测试脚本 (7)3.2.1 插入事务 (7)3.2.2 插入集合点 (8)3.2.3 插入注释 (10)3.2.4 参数化输入 (10)3.3 单机运行测试脚本 (15)4实施测试 (15)4.1 选择脚本,创建虚拟用户 (15)4.2 添加windows资源监视窗口 (19)4.3 添加windows性能计数器 (19)4.4 执行脚本 (21)4.4.1 生成结果 (21)5 分析以及监视场景 (22)5.1 Memory相关 (22)5.2 Processor相关 (25)5.3 网络吞吐量以及带宽 (28)5.4 磁盘相关 (29)5.5 Web应用程序 (30)5.6 SQL Server (31)5.7 Network Delay (31)6 分析实时监视图表 (32)7 分析原则 (32)7.1、错误提示分析 (33)7.2、监控指标数据分析 (33)8.测试结果 (35)1.LoadRunner11基础LoadRunner 是一种预测系统行为和性能的工业标准级负载测试工具。
通过以模拟上千万用户实施并发负载及实时性能监测的方式来确认和查找问题,LoadRunner 能够对整个企业架构进行测试。
通过使用LoadRunner ,企业能最大限度地缩短测试时间,优化性能和加速应用系统的发布周期。
目前企业的网络应用环境都必须支持大量用户,网络体系架构中含各类应用环境且由不同供应商提供软件和硬件产品。
难以预知的用户负载和愈来愈复杂的应用环境使公司时时担心会发生用户响应速度过慢,系统崩溃等问题。
(原创)loadrunner负载测试实例(含步骤)
(原创)loadrunner负载测试实例(含步骤)下面是我做的一个LR负载测试实例,希望和大家讨论下^_^,一起学习。
在此,只说设置虚拟用户,设置场景以及分析运行结果。
硬件环境:硬盘 160G,cpu 1.70GHz,内存2G软件环境:IE6.0, xp sp2,.Net Framework 2.0,Sql Server 2005网络环境: 100M带宽测试工具:LR8.1英文版,设置虚拟IP (在此次测试中没有用到虚拟IP,只是在这顺便写出来)首先,load Generator机器必须使用固定的IP,不能使用动态IP,确定网络中不冲突的IP地址。
1、开始—程序—loadrunner—tools—ip wizard.说明:增加新IP选择第一项;使用保存的文件增加IP选择第二项;释放已经设置的IP 选择第三项。
点‚下一步‛,此处是输入web server的IP地址,不输入,直接点‘下一步’。
说明:使用remove按钮可以删除选定的虚拟IP。
2、点add按钮,说明:‚检查新IP是否已经存在‛选项并没有起作用,根据输入的IP的第一个值和数量,自动添加到虚拟IP列表中,例如:192.168.1.111,则增加的虚拟IP是:192.168.1.111、192.168.67.112、192.168.1.113、192.168.1.114。
点ok按钮,点‚完成‛按钮。
附:使用Save as可以将本次增加的IP保存成.ips文件,下次再使用时就可以直接选择此文件了。
现在需要重启计算机。
(重新启动计算机后,设置的虚拟IP都生效了,此时使用ping会发现都能ping通,并且本机的IP也被改成了第一个虚拟IP地址。
确认虚拟IP是否都生效的方法:在运行中输入cmd,在命令窗口录入ipconfig/all,然后就能看到已经生效的所有IP。
) 使用虚拟IP(以手动方案为例)在controller中,选择 Scenario—Enable IP Spoofer,此项设置允许使用IP欺骗。
Loadrunner性能测试实践
并发性测试需要提前考虑的内容
• 预期性能指标(需考虑软件的扩展) • 独立业务还是组合业务的性能测试 • 疲劳测试,考虑测试持续运行的时间 • 网络带宽等因素是否存在着瓶颈 •…
目录
性能测试基础 Loadrunner基础 脚本录制与开发 场景设计与执行 测试结果分析
完整测试案例——CRM系统性能测试
生成测试脚本。
编辑和完善脚本。 可利用事务、集合 点、检查点、参 数化、关联等技 术。
调试出符合测试 需求,正确的脚 本。
录制前的准备工作
• 熟悉测试业务流程,分析被测业务的前提条件和约束条件, 并做好的准备工作。通过情况下,这部分内容在测试计划测 试数据和测试用例中有相应的说明。
• 录制协议的选择。Loadrunner的工作原理是基于协议数据包 的收发,需要在脚本录制之前确认系统所使用的协议。例如 :假设某系统是基于B/S架构,使用的是HTTP协议,对应在 脚本录制时应选择Web(HTTP/HTML)协议。(可以使用协议 分析软件分析)
常见的性能测试类型
• 基准测试。在性能测试中,可以先通过基准测试来 获取每个在低负载压力下的指标值,然后,依据该 指标业务值,测试人员可以计算和评估系统的并发 用户数、业务并发所需要的数据量等数值。
• 负载测试:确定在各种工作负载下系统的性能,目 标是测试当负载逐渐增加时,系统组成部分的相应 输出项,如响应时间、CPU使用、内存的使用等来决 定系统的性能。
1. 性能测试需求分析与提取 2. 设计测试用例 3. 通过虚拟用户发生器VuGen来设计脚本 4. 通过控制器Controller设计场景 5. 通过负载发生器Load Generator实现虚拟用户并
发执行,同时利 用Controller监控场景 6. 通过分析器Analysis分析结果 7. 生成测试报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
第 1 部分 入门篇............................................................................................... 1
第 1 章 性能测试基础知识.. 3
1.1 性能测试基本概念... 4
1.1.1 什么是性能测试... 4
1.5 本章小结... 28
第 2 章 LoadRunner 基础知识.. 29
2.1 LoadRunner 简介... 29
2.1.1 LoadRunner 主要特点... 29
2.1.2 LoadRunner 常用术语... 31
2.2 LoadRunner 工作原理... 32
2.3 LoadRunner 测试流程... 33
5.4.2 事务性能报告(Performance Reports)... 196 5.4.3 HTML 与 Word 报告... 199 5.5 本章小结... 206 第 3 部分 探索篇.......................................................................................... 209 第 6 章 用 Visual C++增强虚拟用户.. 211 6.1 认识 LoadRunner 动态链接库的调用功能... 211 6.1.1 动态链接库调用功能简介... 211 6.1.2 动态链接库调用功能适用范围... 212 6.2 创建与调用动态链接库... 212 6.2.1 用 Visual C++创建 Dll 212 6.2.2 Dll 调用方法... 215 6.2.3 载入头文件方法... 217 6.2.4 Dll 调用需注意的问题... 220 6.3 UDP 发包应用案例... 222 6.3.1 测试内容简介... 222 6.3.2 测试程序设计... 222 6.3.3 虚拟用户脚本... 223 6.3.4 测试场景设置... 224 6.3.5 测试结果分析... 225 6.4 本章小结... 226 第 7 章 深入 Java 虚拟用户.. 227 7.1 认识 Java 虚拟用户... 227 7.1.1 Java 虚拟用户协议... 227 7.1.2 Java 虚拟用户适用范围... 230 7.1.3 脚本开发环境配置... 231 7.2 Java 脚本开发基础... 234 7.2.1 Java 虚拟用户开发基础... 234 7.2.2 LoadRunner 的 Java API. 243
3.1 Virtual User Generator 简介... 45
3.1.1 VuGen 录制原理... 46 3.1.2 VuGen 功能简介... 48 3.1.3 如何选择协议... 49 3.2 VuGen 录制功能详解... 50 3.2.1 录制参数设置... 50 3.2.2 脚本录制与创建事务... 57 3.2.3 回放与调试脚本... 61 3.2.4 脚本录制的基本原则... 63 3.3 修改虚拟用户脚本... 64 3.3.1 参数化功能... 64 3.3.2 深入集合点... 71 3.3.3 巧用检查点... 72 3.3.4 关联... 78 3.4 配置虚拟用户脚本... 80 3.5 两个常用函数介绍... 84 3.6 本章小结... 86 第 4 章 场景的创建与执行.. 87 4.1 Controller 简介... 87 4.2 场景类型介绍... 88 4.2.1 手动测试场景... 88 4.2.2 面向目标的测试场景... 90 4.3 测试场景设计... 93 4.3.1 配置测试脚本... 93 4.3.2 配置 Generator 94 4.3.3 配置 Schedule. 95 4.3.4 集合点配置... 99 4.3.5 IP Spoofer 配置... 100 4.3.6 其他设置场景... 106
7.3 Java 算法测试案例... 245 7.4 本章小结... 260 第 8 章 深入.NET 虚拟用户.. 261 8.1 认识.NET 虚拟用户... 261 8.1.1 .NET 虚拟用户适用范围... 261 8.1.2 安装与配置.NET 插件... 262 8.2 创建.NET 虚拟用户... 264 8.2.1 创建虚拟用户项目... 264 8.2.2 参数、集合点、事务... 266 8.3 网站视频性能测试应用案例... 271 8.3.1 创建自定义的播放器类... 272 8.3.2 创建抽象虚拟用户类... 276 8.3.3 创建抽象并发测试类... 282 8.3.4 创建自定义虚拟用户脚本... 284 8.3.5 创建 LoadRunner .NET 虚拟用户... 287 8.3.6 案例总结... 290 8.4 本章小结... 290 第 9 章 LoadRunner 特殊协议应用.. 291 9.1 Windows Sockets 协议应用... 291 9.1.1 录制 Windows Sockets 协议脚本... 292 9.1.2 增强 Windows Sockets 协议脚本... 294 9.2 WAP 协议应用... 298 9.3 Web Services 协议应用... 302 9.3.1 Web Services 协议简介... 302 9.3.2 录制 Web Services 协议脚本... 303 9.4 FTP 协议应用... 312 9.5 本章小结... 317 第 4 部分 实战篇.......................................................................................... 319
内容介绍:
LoadRunner 性能测试实战讲解
很多使用 LoadRunner 的测试人员经常面临两个难题:脚本开发与性能测试分析。本书就是基于帮助测试人 员解决这两个问题而编写,致力于使读者学精 LoadRunnner 这一强大的性能测试工具。 全书共分为四部分:入门篇、基础篇、探索篇、实战篇。第一篇入门篇的内容包括第 1 章和第 2 章,着重 于讲解性能测试与 LoadRunner 的基础理论知识。第二篇基础篇的内容包括第 3 章至第 5 章,是 LoadRunner 的基本使用部分,着重讲解 Virtual User Generator、Controller、Analysis 的使用方法。第三篇探索篇的...
前言
在作者的另一作品《Web 性能测试实战》中,曾经提到过“软件亚健康”这个概念。现在, 亚健康不但威胁着 IT 人的生活质量,也威胁很多应用软件的性能。为此,在《Web 性能测 试实战》一书中,作者提出了“全面性能测试模型”,期望能够成为解决软件亚健康问题的一 剂“良药”。
“全面性能测试模型”包含了测试策略制定、测试用例设计、模型使用方法三部分内容, 基本覆盖了性能测试规划和设计的相关内容,为开展性能测试提供了一种可行的方案。借助 本模型,软件开发和测试人员可以更好的组织与规划性能测试,避免在项目后期遭遇性能问 题的被动局面。
1.1.2 性能测试应用领域... 6
1.1.3 性能测试常见术语... 8
1.2 全面性能测试模型... 11
1.2.1 性能测试策略模型... 14
1.2.2 性能测试用例模型... 17
1.2.3 模型的使用方法... 20
1.3 性能测试调整基础... 21
1.4 如何做好性能测试... 24
2.4 LoadRunner 的部署与安装... 35
2.5 本章小结... 41
第 2 部分 基础篇............................................................................................. 43 第 3 章 脚本的录制与开发.. 45
附录 A LoadRunner 性能测试常见问题.. 365 附录 B LoadRunner 性能测试模板.. 373 B.1 性能测试计划模板... 373 B.1.1 项目背景简介... 373 B.1.2 测试方案简介... 373 B.1.3 测试环境与资源... 373 B.1.4 项目里程碑... 374 B.1.5 技能培训计划... 374 B.1.6 风险分析... 374 B.1.7 计划结束标准... 374 B.2 性能测试用例模板... 374 B.2.1 文档介绍... 374 B.2.2 测试需求分析... 375 B.2.3 性能测试用例... 375 B.3 性能测试报告模板... 380 B.3.1 基本信息... 380 B.3.2 测试环境描述... 381 B.3.3 性能测试用例执行分析... 381 B.3.4 测试结果综合分析及建议... 381 B.3.5 测试经验总结... 381 后 记.. 383
4.4 执行测试场景... 108 4.4.1 启动测试场景... 108 4.4.2 控பைடு நூலகம்用户与用户组... 108 4.4.3 查看场景与用户状态... 109 4.4.4 控制集合点... 110 4.4.5 查看运行数据图... 110 4.5 监控系统资源... 111 4.5.1 监控 Windows 系统资源... 112 4.5.2 监控 Linux/Unix 系统资源... 114 4.6 本章小结... 121 第 5 章 性能测试结果分析.. 123 5.1 如何分析性能测试结果... 124 5.1.1 性能分析基础知识... 125 5.1.2 Analysis 使用基础... 127 5.1.3 一个视频网站例子... 135 5.2 如何从分析图中发现问题... 148 5.2.1 虚拟用户图... 148 5.2.2 事务图... 151 5.2.3 Web 资源图... 160 5.2.4 网页细分图... 166 5.2.5 小结... 179 5.3 分析图的处理方法... 179 5.3.1 修改默认配置... 180 5.3.2 合并分析图... 187 5.3.3 自动关联... 188 5.3.4 场景运行比较... 191 5.4 Analysis 分析报告... 193 5.4.1 事务活动报告(Activity Reports)... 193