LoadRunner性能测试实战教程
- 格式:pdf
- 大小:1.37 MB
- 文档页数:95
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基本操作姓名:学号:一、实验目的(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.。
使用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测试步骤详细步骤录制测试脚本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。
实验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性能测试演示过程目录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负载测试实例(含步骤)下面是我做的一个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欺骗。