软件测试案例分析 实验三LoadRunner检查点DOC.docx

上传人:b****9 文档编号:25775996 上传时间:2023-06-13 格式:DOCX 页数:30 大小:999.63KB
下载 相关 举报
软件测试案例分析 实验三LoadRunner检查点DOC.docx_第1页
第1页 / 共30页
软件测试案例分析 实验三LoadRunner检查点DOC.docx_第2页
第2页 / 共30页
软件测试案例分析 实验三LoadRunner检查点DOC.docx_第3页
第3页 / 共30页
软件测试案例分析 实验三LoadRunner检查点DOC.docx_第4页
第4页 / 共30页
软件测试案例分析 实验三LoadRunner检查点DOC.docx_第5页
第5页 / 共30页
点击查看更多>>
下载资源
资源描述

软件测试案例分析 实验三LoadRunner检查点DOC.docx

《软件测试案例分析 实验三LoadRunner检查点DOC.docx》由会员分享,可在线阅读,更多相关《软件测试案例分析 实验三LoadRunner检查点DOC.docx(30页珍藏版)》请在冰豆网上搜索。

软件测试案例分析 实验三LoadRunner检查点DOC.docx

软件测试案例分析实验三LoadRunner检查点DOC

南昌航空大学实验报告

2013/06/06

 

课程名称:

软件测试案例分析实验名称:

LoadRunner检查点

班级:

姓名:

同组人:

指导教师评定:

签名:

一、实验目的

(1)理解和掌握性能测试的基本原理和方法。

(2)掌握LR检查点的使用与脚本设计。

二、实验要求

(1)运用LR录制订票操作的脚本。

(2)回放脚本,观察结果。

(3)对订票的金额设置检查点。

三、实验内容

(一)、使用LR录制mercurytours订票系统订票操作的脚本。

具体步骤如下:

(1)打开LR的录制配置窗口,将登陆页面的脚本录制到vuser_init动作中(确认将Winxp系统的防火墙关闭)。

如下图所示:

(2)开始录制,打开http:

//localhost/MercuryWebTours/订票页面,选择用户jojo/bean,或者joe/young登陆订票系统,如下图所示;

(3)重新选择recording窗口的动作下拉列表,将以下的操作录制到action动作中;

(4)继续录制操作,点击flights按钮,进入订票窗口,选择DepartureCity为Frankfurt,ArrivalCity为London,NoofPassengers为1,其他为默认设置,如下图所示:

(5)点击continue按钮,继续录制,进入航班选择页面,选择起飞时间为8am的航班,如下图所示:

 

(6)点击continue按钮,继续录制,进入信用卡支付页面,如下图所示:

(7)在creditcard中输入560245062220,ExpDate输入08/16,点击purchaseflight按钮。

进入机票确认窗口。

如下图所示:

 

(8)订票结束,点击signoff按钮返回登录页面。

(二)、下面通过设置检查点函数来检查页面中的相关信息,步骤如下:

(1)使用web_find()函数,来检查登录成功以后的欢迎页面是否是以“Welcome”开始的。

如下图所示:

函数作用:

在页面中查找相应的内容

参数举例:

web_find("web_find","RighOf=a","LeftOf=b","What=name",LAST);

参数解释:

"web_find"定义该查找函数的名称;“LeftOf”和“RighOf=”用来定义查找字符的左右边界;“What=”定义查找内容。

例如上述参数举例中的意思就是在页面中查找左边界为b,右边界为a,内容为name的信息

函数用法:

该函数是在查找页面中的内容,所以要放在要查找的内容的后面。

注意事项:

使用该函数时,要在Vuser->Run-TmeSettings中更改下设置

勾选EnableImageandtextcheck

系统默认是不勾选该选项的。

关于该函数的其他说明:

该函数只能在基于HTML模式录制的脚本中进行查找。

(2)由于欢迎页面“Welcome”的右侧是逗号“,”,所以在VUGen中,将scriptview切换为Treeview,在vuser_init动作中,选择submitform:

login.pl,鼠标右键单击选择insertafter…,如下图所示:

(3)在插入窗口中展开webchecks,选择TextCheck,选择ok,如下图所示:

(4)选择OK以后,在TextCheckProperties的设置窗口中,输入Searchfor为Welcome,

选中Leftof,表示应在某文本的左边出现,输入逗号”,”,点击确定。

(5)将VUGen返回scriptview视图,此时在Vuser_init中可以查看到插入的文本检查点脚本。

如下图所示:

(6)由于web_find是在页面中查找文本是否出现,最好在web_submit_form的脚本后插入thinktime,保证等待页面打开后再来查找检查点的文本,因此修改脚本如下所示:

(7)脚本确认以后,回放脚本,查看executionLog,能发现如下的日志“web_findsuccessful.1occurrence(s)of“Welcome”found”,表示检查点执行正确:

(三)若检查订单确认页面的“Totalcost”是否为266,请录制脚本设置检查点。

(四)在订票系统登录后,将显示欢迎的页面,具体页面如下:

 

在该页面中,如果以joe登陆,则在页面中将显示welcome,joe,….,如何检查系统是否显示了当前登陆的用户?

此时,可以通过带参数的web_find函数来检查。

(1)新建一个新的LR脚本文件,重新录制订票系统的登陆脚本(由于该脚本将循环执行,所以应录制到action动作中),并将用户名和密码参数化,其中用户名和密码如下所示(注意存储数据的文件名为username.dat):

UsernamePassword

joeyoung

jojobean

(2)在treeview视图下,选择submitform,在右键菜单中选择”InsertAfter…”,插入检查函数web_find;

 

(3)在插入窗口中展开webchecks,选择TextCheck,选择ok,如下图所示:

(4)选择OK按钮后,在TextCheckProperties窗口的searchfor文本框中选择,按钮abc,表示将要搜索的文本参数化,

(5)在弹出的selectorcreateparameter的窗口中,输入parametername为username

,点击proerties按钮,在弹出的参数属性窗口中,选择filepath为之前参数的数据文件username.dat.在selectcolumn中选择1,表示从数据文件的第一列取数据。

(6)设置完成后,点击close,点击确定,返回web_found的设置窗口,如下图所示:

(7)在leftof文本框中输入逗号”,”,点击确定。

(8)点击确定后,返回到scriptview,能查看到插入的web_find函数。

(9)在scriptview视图中,选择action,右键点击选择runtimesettings,如下图所示:

(10)在runlogic中设置循环次数为2,点击确定。

(11)在preferences中,勾选EnableImageandtextcheck

系统默认是不勾选该选项的。

(12)回放脚本,在excutionlog中,能发现两个用户名都带入并且在页面中存在。

(13)将参数的数据文件加入一组新的用户名和密码:

tom/mountain,将循环次数设置为3,重新运行脚本,观察结果。

将脚本和报告以及执行日志保存到实验报告。

脚本:

"URL=http:

//localhost/MercuryWebTours/",

"Resource=0",

"RecContentType=text/html",

"Referer=",

"Snapshot=t1.inf",

"Mode=HTML",

LAST);

web_submit_form("login.pl",

"Snapshot=t2.inf",

ITEMDATA,

"Name=username","Value={username}",ENDITEM,

"Name=password","Value={password}",ENDITEM,

"Name=login.x","Value=58",ENDITEM,

"Name=login.y","Value=13",ENDITEM,

LAST);

web_find("web_find",

"LeftOf=,",

"What={username}",

LAST);

web_image("SignOffButton",

"Alt=SignOffButton",

"Snapshot=t3.inf",

LAST);

return0;

}

 

执行日志:

VirtualUserScriptstarted

Startingactionvuser_init.

WebTurboReplayofLoadRunner7.80.0forWINXP;Webbuild2271[MsgId:

MMSG-27143]

Run-TimeSettingsfile:

"C:

\DocumentsandSettings\Administrator\LocalSettings\Temp\noname1\\default.cfg"[MsgId:

MMSG-27141]

Endingactionvuser_init.

RunningVuser...

Startingiteration1.

StartingactionAction.

Action.c(6):

Detectednon-resource"http:

//localhost/MercuryWebTours/header.html"in"http:

//localhost/MercuryWebTours/"[MsgId:

MMSG-26574]

Action.c(6):

Detectednon-resource"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=true"in"http:

//localhost/MercuryWebTours/"[MsgId:

MMSG-26574]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/banner_animated.gif"inHTML"http:

//localhost/MercuryWebTours/header.html"[MsgId:

MMSG-26659]

Action.c(6):

Detectednon-resource"http:

//localhost/MercuryWebTours/nav.pl?

in=home"in"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=true"[MsgId:

MMSG-26574]

Action.c(6):

Detectednon-resource"http:

//localhost/MercuryWebTours/home.html"in"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=true"[MsgId:

MMSG-26574]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/banner_merctur.jpg"inHTML"http:

//localhost/MercuryWebTours/home.html"[MsgId:

MMSG-26659]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/sun_swede.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

in=home"[MsgId:

MMSG-26659]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/login.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

in=home"[MsgId:

MMSG-26659]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/signup.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

in=home"[MsgId:

MMSG-26659]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/admin.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

in=home"[MsgId:

MMSG-26659]

Action.c(6):

web_urlwassuccessful,51016bodybytes,2125headerbytes[MsgId:

MMSG-27176]

Action.c(15):

Submittingformto"http:

//localhost/MercuryWebTours/login.pl",TargetFrame="body"[MsgId:

MMSG-27978]

Action.c(15):

Detectednon-resource"http:

//localhost/MercuryWebTours/nav.pl?

page=menu&in=home"in"http:

//localhost/MercuryWebTours/login.pl"[MsgId:

MMSG-26574]

Action.c(15):

Detectednon-resource"http:

//localhost/MercuryWebTours/login.pl?

intro=true"in"http:

//localhost/MercuryWebTours/login.pl"[MsgId:

MMSG-26574]

Action.c(15):

Foundresource"http:

//localhost/MercuryWebTours/images/sun_with_logo.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

page=menu&in=home"[MsgId:

MMSG-26659]

Action.c(15):

Foundresource"http:

//localhost/MercuryWebTours/images/flights.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

page=menu&in=home"[MsgId:

MMSG-26659]

Action.c(15):

Foundresource"http:

//localhost/MercuryWebTours/images/itinerary.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

page=menu&in=home"[MsgId:

MMSG-26659]

Action.c(15):

Foundresource"http:

//localhost/MercuryWebTours/images/in_home.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

page=menu&in=home"[MsgId:

MMSG-26659]

Action.c(15):

Foundresource"http:

//localhost/MercuryWebTours/images/signoff.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

page=menu&in=home"[MsgId:

MMSG-26659]

Action.c(15):

Resource"http:

//localhost/MercuryWebTours/images/banner_merctur.jpg"isinthecachealreadyandwillnotbedownloadedagain[MsgId:

MMSG-26655]

Action.c(15):

web_submit_formwassuccessful,12483bodybytes,1693headerbytes[MsgId:

MMSG-27176]

Action.c(23):

"web_find"successful.1occurrence(s)of"jojo"found(RightOf="",LeftOf=",")[MsgId:

MMSG-27196]

Action.c(23):

web_findwassuccessful[MsgId:

MMSG-27182]

Action.c(28):

Image-linkingto"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=1",TargetFrame="body"[MsgId:

MMSG-27993]

Action.c(28):

Detectednon-resource"http:

//localhost/MercuryWebTours/nav.pl?

in=home"in"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=1"[MsgId:

MMSG-26574]

Action.c(28):

Detectednon-resource"http:

//localhost/MercuryWebTours/home.html"in"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=1"[MsgId:

MMSG-26574]

Action.c(28):

Resource"http:

//localhost/MercuryWebTours/images/banner_merctur.jpg"isinthecachealreadyandwillnotbedownloadedagain[MsgId:

MMSG-26655]

Action.c(28):

Resource"http:

//localhost/MercuryWebTours/images/sun_swede.gif"isinthecachealreadyandwillnotbedownloadedagain[MsgId:

MMSG-26655]

Action.c(28):

Resource"http:

//localhost/MercuryWebTours/images/login.gif"isinthecachealreadyandwillnotbedownloadedagain[MsgId:

MMSG-26655]

Action.c(28):

Resource"http:

//localhost/MercuryWebTours/images/signup.gif"isinthecachealreadyandwillnotbedownloadedagain[MsgId:

MMSG-26655]

Action.c(28):

Resource"http:

//localhost/MercuryWebTours/images/admin.gif"isinthecachealreadyandwillnotbedownloadedagain[MsgId:

MMSG-26655]

Action.c(28):

web_imagewassuccessful,2368bodybytes,652headerbytes[MsgId:

MMSG-27176]

EndingactionAction.

Endingiteration1.

Startingiteration2.

StartingactionAction.

Action.c(6):

Detectednon-resource"http:

//localhost/MercuryWebTours/header.html"in"http:

//localhost/MercuryWebTours/"[MsgId:

MMSG-26574]

Action.c(6):

Detectednon-resource"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=true"in"http:

//localhost/MercuryWebTours/"[MsgId:

MMSG-26574]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/banner_animated.gif"inHTML"http:

//localhost/MercuryWebTours/header.html"[MsgId:

MMSG-26659]

Action.c(6):

Detectednon-resource"http:

//localhost/MercuryWebTours/nav.pl?

in=home"in"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=true"[MsgId:

MMSG-26574]

Action.c(6):

Detectednon-resource"http:

//localhost/MercuryWebTours/home.html"in"http:

//localhost/MercuryWebTours/welcome.pl?

signOff=true"[MsgId:

MMSG-26574]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/banner_merctur.jpg"inHTML"http:

//localhost/MercuryWebTours/home.html"[MsgId:

MMSG-26659]

Action.c(6):

Foundresource"http:

//localhost/MercuryWebTours/images/sun_swede.gif"inHTML"http:

//localhost/MercuryWebTours/nav.pl?

in=home"[MsgId:

MMSG-26659]

Action.c(6):

Foundresource"http:

//localhost/Mercury

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 动物植物

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1