LoadRunner案例分析.docx
- 文档编号:5583954
- 上传时间:2022-12-28
- 格式:DOCX
- 页数:13
- 大小:22.16KB
LoadRunner案例分析.docx
《LoadRunner案例分析.docx》由会员分享,可在线阅读,更多相关《LoadRunner案例分析.docx(13页珍藏版)》请在冰豆网上搜索。
LoadRunner案例分析
LoadRunner案例分析
(一)来源:
作者:
日期:
2008-06-16【聚杰网测试工具】LoadRunner案例分析
(一)
昨天和Zee兄交流的时候,探讨了最近无忧测试论坛上的两个问题,我们俩的看法基本一致。
第一个问题:
是如何利用LoadRunner判断HTTP服务器的返回状态。
两种方法,第一种方法是利用LR的内置函数web_get_int_property,如下是一个简单的例子:
{
intHttpRetCode;
web_url(”my_home”,“URL=,“TargetFrame=_TOP”,LAST);
HttpRetCode=web_get_int_property(HTTP_INFO_RETURN_CODE);
…
if(HttpRetCode==200)
lr_log_message(”ThescrīptsuccessfullyaccessedtheMy_homehomepage”);
else
lr_log_message(”ThescrīptfailedtoaccesstheMy_homehomepage“);
}
另外一种就是最原始的办法,也是Zee兄这种高手才最先想到的,自己取HTTP服务器的数据,然后利用关联函数分析啊。
(果然是高啊)。
其实所有的东西都可以从服务器的返回取,然后自己动手解析,呵呵。
举个不太恰当的例子:
你需要一套家具,可以去家具市场挑,当然也可以自己买木材原料和工具,动手加工。
那才是最合乎自己需要的。
第二个问题:
动态数据参数化的问题。
其实第一次看到这个问题,我没有马上反应过来,后来仔细想想,明白了。
就是需要参数化的数据不是静态的,是动态的。
比如从数据库中选出来的。
针对这个问题,我跟Zee兄弟的看法一致,应该提前从数据源(比如数据库)把数据选取出来,然后在执行的时候直接进行参数化的选取。
反之,如果在程序执行期间,进行数据的选取,将可能带来数据库服务器的强大压力,因为参加并发执行的每个虚拟用户都去数据库搜刮一下,对数据库将是多么严峻的考验啊。
朋友或者同事之间的探讨是加深对问题理解和增加知识面,扩展视野最直接的途径和方法,加强沟通,keepintouch.
LoadRunner案例分析
(二)
昨天在广州交流会开始之前,一个朋友问起这样一个问题:
他们公司的系统上线以后,用户分布在各个不同的地区,而且接入系统的方式和带宽也不同,这种情况下进行性能测试,如何保证更加真实的模拟用户行为用LoadRunner可以做到吗
^
回答当然是肯定的,其实这些都是简单问题的组合,这样的问题考察的也是你对工具的熟悉和掌握程度。
在VUGen里面,是可以通过RTS(runTimeSetting)来模拟一个单个用户更加真实的行为,比如思考时间,网络带宽,是否清除cache等等。
同样的设置也可以在场景中进行设置。
而且LoadRunner提供设置不同用户组不同RunTimeSetting的功能。
以达到模拟不同用户行为的更加真实组合。
假设有三种不同带宽的用户,而且上传和下载的带宽也有所不同,那么可以录制两个脚本,分别模拟上传和下载的用户行为,再Controller里面,建立六个不同的脚本组,脚本组的用户数可以按照绝对或者百比分的方法分布。
比如100,50,200用户或者20%,40%,40%等,这取决于你的业务模型。
然后设置不同的带宽和分布情况。
这样不同用户组的虚拟用户模拟出来的就是不同带宽的用户实际接入情况。
就可以满足之前的问题的要求
LoadRunner案例分析(三)来源:
作者:
日期:
2008-06-16【聚杰网测试工具】LoadRunner案例分析(三)
把昨天的功课补了,本来打算昨天分析一个典型案例,可惜太忙了。
所以这么说。
以前一直没有解决的问题,利用LoadRunner测试一个应用的时候,需要验证域用户,所以即使录制成功,每次回放的时候都提示错误,用户名和密码不对,对此耿耿于怀了很久。
今天居然解决了。
解决方法就是一个简单的函数调用:
web_set_user,此函数的解释和用法如下:
Theweb_set_userfunctionisaServicefunctionthatspecifiesaloginstringandpasswordforaWebserverorproxyserver.Itcanbecalledmorethanonceifseveralproxyserversrequireauthentication.web_set_useroverridestherun-timeproxyauthenticationsettingsforusernameandpassword.
/
Whenyoulogontoaserverthatrequiresuserandpasswordvalidation,VuGenrecordsaweb_set_userstatementcontainingthelogindetails.However,therearesomemorestringent,authenticationmethodsforwhichVuGenisunabletoinsertweb_set_userstatements.SeeUserAuthenticationformoredetail.Insuchcases,youcanaddweb_set_userintoyourscrīptmanually.
Whenyourunthescrīpt,LoadRunnerautomaticallysubmitstheuserauthorizationalongwitheverysubsequentrequesttothatserver.Attheendofthescrīpt,LoadRunnerresetstheauthorization.
ThisfunctionissupportedforallWebVusers,andforWAPVusersrunninginHTTPmodeonly.ItisnotsupportedforWAPVusersrunninginWirelessSessionProtocol(WSP)replaymode.
Example3
ThefollowingexamplewasinsertedmanuallybytheuserintothescrīptastheWebserver“mansfield”usesNTLMauthentication.VuGencannotrecordNTLMorDigestauthentication.NotethatforNTLMauthenticationthedomainname“mansfield”followedbyadoublebackslashmustbeprependedtotheusername:
&
web_set_user(“mansfield46246a2633f042c063c6726009A91C2008-06-162008-06-16Warning(218:
9f0)]RequestConnection:
RemoteServer@:
80(Service=)Failedattempt#3.Unabletoconnecttoremoteserver:
rc=-1,le=0)
[NetAn.Error(218:
9f0)]RequestConnection:
RemoteServer@:
80(Service=)NOTPROXIED!
(REASON:
Unabletoconnecttoremoteserver:
rc=-1,le=0)
重新安装了LoadRunner,结果同样。
从错误的表面看是代理的问题,但是本机上网不需要任何代理。
也没有设置任何的代理。
搜了一下,发现了问题的解决方法。
其实挺搞笑的。
居然是杀毒软件的问题。
下面是详细的讨论经过(英文的,大家将就看,看不懂就查查辞典)
==================================================
:
I‘veinstalledLRonanewmachineandI’mencounteringanerroratrecordtime.ThisistheerrorasrecordedagainstloadingtheGooglehomepage,alongwiththethreewarningsthatproceedit:
[NetAn.Warning(218:
9f0)]RequestConnection:
RemoteServer@:
80(Service=)Failedattempt#1.Unabletoconnecttoremoteserver:
rc=-1,le=0)
[NetAn.Warning(218:
9f0)]RequestConnection:
RemoteServer@:
80(Service=)Failedattempt#2.Unabletoconnecttoremoteserver:
rc=-1,le=0)
[NetAn.Warning(218:
9f0)]RequestConnection:
RemoteServer@:
80(Service=)Failedattempt#3.Unabletoconnecttoremoteserver:
rc=-1,le=0)
[NetAn.Error(218:
9f0)]RequestConnection:
RemoteServer@:
80(Service=)NOTPROXIED!
(REASON:
Unabletoconnecttoremoteserver:
rc=-1,le=0)
&
I‘vereinstalledLRtwicewiththesameresults.
OneotherthingI‘venoticedisthatunderRun-timeSettings,thebrowseremulationwassettoIE4andnoO/S.IinstalledLRonasecondmachineandthesettingisIE6/NT.Therecorderalsoworkedasexpected.HoweverthisisanolderboxandI’drathernotuseit.
TheMercuryforumspointtopossiblespyware,butthenewmachineisclean.Ifanyonehasanyinformationitwouldbemostappreciated.1.WhatversionofLoadRunnerorPerformanceCenterareyouusing8.1.0.0
2.WhatistheprotocolyouarerecordingHTTP/HTML
IfHTML-areyouusingHTML-AdvancedwithURLsor,NO
?
URLmodewithConcurrentgroups,orNO
URLmodewithoutConcurrentgroupsNO
3.WhichLoadRunner/PerformanceCenterfeatureorservicepacksareyouusingNone
4.WhatkindofLoadRunnerlicensedoyouhave-Subscrīption,Perpetual,VirtualUserdays,orEvaluation(choosetheonethatfitsyourlicensemodel)Evaluation
Ifsubscrīption,issubscrīptioncurrentorexpired
<
5.Whatplatform(s)andOperatingSystemsIncludeversionandservicepacks.IESP2andXPSP2
6.IfyouhavefiledaservicerequestwithMercury,whathavetheytoldyouatthispointwithrespecttoyourissue
I‘llbefilinganSRtoday.
Thanks,
Dan
$
Dan,sinceyouareusingtheevaluationversion,pleaseturnyourquestionstoyourfieldsalesengineerforHP|MercuryoryourVARforassistancepriortoyoursale.ItistheirjobtomakesureallengineeringissuesareaddressedpriortoyourpurchaseofLoadRunner,justasitisthesalesrepresentative‘sjobtomakesureallorganizationalandlogisticalissuesareaddressedpriortoyourpurchase.IfyourVARorvendorsalesengineerisunresponsivetoyourinquiries,thenseekanewrepresentativetoworkwith.However,ithasbeenmyexperiencethataslightthreattogowithanothervendorthatcanbettersupportyourenvironmenttendstolightthefireundermostsalestypes,particularlywithaproductlikeLoadRunnerthateasilycanexceed$100,USDwhenoptionedout.
ThankyouforyourinterestinevaluatingLoadRunnerpriortoyourpurchase.
JamesPulley
====================================================
Thanksforthesuggestion.
:
Thecontrollerlicenseispurchasedandthisisthemachinedesignatedforactivation.I‘mdealingwithMercuryonthisissueaswell.
ThisisnotthefirsttimeI‘vehadinstallationissueswithaMercuryproductandI’msureitwon‘tbethelast.AsImentionedthisisanewlaptopsomaybethathassomethingtodowithit.ButI’veseenoneotherpostinthisforumdescribingmysameproblemandtherewasnoresolutionsoI‘mnotoptimisticthatthiswillberesolvedquickly.
IfMercury/HPprovidesasolutionI‘llpostithere.
======================================================
AMercuryengineerprovidedaworkaroundforthisrecordingerror.UnderTools->RecordingOptions->Network->PortMapping,thecapturelevelwaschangedfrom‘SocketLevelData’to‘WinINetleveldata’。
】
WhenIgetthefixfor‘SocketLevelData’recordingerroronthisPC,I‘llpostithere.
Dan
=========================================================
Thanks,Dan.Youmaynotknowit,butitalltoorareforpeopletocomebackandpostsolutions,sowearetrulygrateful.
================================================
*
ThanksforthatPeter.IfinditworthwhiletopostresolutionsasIhopetheycanhelpothers.
SoIsolvedmyproblem.DiggingintotheprocessexplorerpointedtothefromWaveSystems.IGoogleditandfoundseveraldiscussionforumsindicatingitcausesproblemswithotherapplicationsaswell.ThepatchdownloadlinkontheWavewebsitewasdead.Idon‘tneedbiosecurityonmyDellsoIuninstalledthewholeprogramgroup.VUGENisnowworkingasexpected.
Goodlucktoall,
Dan
====================
;
soletmegetthisstraight…youhavetodisablethebiosecurityonthecomputertogetittoworkSeemslikeaninterestingproblemifyouarerequiredtohavethesecurityonasacompanypolicy.
================
That‘sagreatpointjamessoandIagree;thiswasn’tthesolutionIwaslookingfor.Unfortunatelythereismoregoingonhere.WeaquiredatermlicensewithMercury/HPanditactivatedthevirtualuserstwoweeksago,eventhoughtheinstallationonthecontrollerdidnotgoasplanned.ButI‘matthepointnowwherewe’vealreadyburnttoomuchandcan‘taffordtoburnanymoreofthelicense.IhavetogetbackontrackwiththeclientsoI’mgoingwiththisfornow.
Regards,
Dan
|
======================
Sothetermlicensestartedbeforeyoucouldactuallygetacontrollerworkingtousethem…。
hmmm.IsHPflexibleenoughtoownthisproblemandgiveyoutimethatyoulost
=======================
Timewilltelljamesso.IdowantthattimebackandIamlookingforconsideration,butatthispointI‘mnotoptimistic.
Idon‘tmindsayingatthispointthatIwasunhappywithbeingtiedtoastartdatetobeginwith.ThisisthefirsttimeI’veworkedw
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- LoadRunner 案例 分析