LoadRunner脚本录制常见问题整理
LoadRunner脚本中的乱码问题以及解决办法
相信有不少人在使用LoadRunner的过程中都遇到过这样的问题:在录制下来的脚本的中文信息出现了乱码。
关于乱码问题,可能大家在网上也能搜到不少相关的解决办法,我在这里就不多说了,大家自己去试验一下吧,到底哪个办法有效也就只有谁用谁知道了!我这里只举一个自己遇到的实际例子来说这个问题,也许不是解决这个问题的唯一办法,但至少也是其中的一个吧。
被测系统采用Ajax技术,通过录制下来的脚本看起来像下面的样子(省略函数其它部分,下同):web_custom_request("CALL-H001I","EncType=text/xml; charset=UTF-8","BodyBinary=CALLH001I1040浣忔埧01鏆傛棤鍙风爜<PAPERGR ant organ>1110000001000000.00A110102*********#1闇嶈景榫""""x99" "10001鍘﹂棬100A1442000050031"r"n" "", LAST);从上面脚本的黑体部分可以看出,LoadRunner向服务器提交的请求body部分,输入的中文字段被变成了诸如“浣忔埧”这样的乱码。
遇到这样的情况,相信大多数人和我最开始一样,只能不加理会,直接点击回放,然后我们很高兴地发现,脚本回放成功了!这些乱码是可以被LR识别的,而且到应用系统中查看运行的结果,也没有问题,显示的是正确的中文。
但是且慢!先不要高兴得太早,我们很快就会意识到:如果这个字段我们是需要进行参数化的怎么办?我们应该如何造出这种乱码的字呢?首先,我们直接用正常的字去参数化,这里只举其中的一个例子来说明,比如这个字段,我们用参数值“汽车”直接在脚本中替换“浣忔埧”,脚本回放失败。
loadrunner常见问题及解决方法
loadrunner常见问题及解决⽅法loadrunner常见问题1..关于loadrunner11录制脚本时IE打不开问1、ie浏览器去掉启⽤第三⽅浏览器扩展2、loadrunner11 键盘F4,在browser Emulation点击change,在弹出的提⽰框中Browser version 选择8.0,platform. 选择windows73、loadrunner11 键盘ctrl+F7在弹出的提⽰框中选择最后⼀项Correlation,将Enable correlation during recording 下⾯的勾全去掉,有需要的再勾4、退出杀毒软件(⾦⼭啊360啊什么的都退了)5、退出迅雷软件6、计算机——属性——⾼级系统设置——性能⾥的设置——数据执⾏保护——选择“为除下列选定程序之外的所有程序和服务启⽤”——添加IE浏览器——应⽤——确定1.2.controlle打开失败:controller⼀添加完脚本就崩溃了,报错:试读执⾏系统不⽀持的操作;Runtime error!c:\ProgramFiles\hp\LoadRunner\bin\Wlrun.exe abnormal program termination。
解决⽅案:1.E:\Program Files (x86)\HP\LoadRunner\bin⽂件下将wlrun.exe⽂件删除,2.进⼊“我的电脑”下---控制⾯板\卸载或更改程序中---右击HP Loadrunner修复。
1.3.设置并发数:User generator tools—create controller scenario—number of vusers1.4.Loadrunner11安装:1. 安装完成后,退出loadrunner2. 把下载的lm70.dll,mlr5lprg.dll 拷贝到../HP/Loadrunner/bin覆盖掉原来的3. 使⽤注册表删除⼯具,点击deletelicense.exe 删除注册表信息4. 再次打开loadrunner, configuration->loadrunner license->new license,在弹出的输⼊框中输⼊license序列号100 vuser: AEAMAUIK-YAFEKEKJJKEEA-BCJGI10000 vuser: AEABEXFR-YTIEKEKJJMFKEKEKWBRAUNQJU-KBYGB超级license,⽀持6.5w个并发: AEACFSJI-YJKJKJJKEJIJD-BCLBR破解⽅⾯的东西⽹上多如⽜⽑,就不再说了。
loadrunner initialize record fail
loadrunner initialize record fail "LoadRunner initialize record fail" 是一个与LoadRunner 性能测试工具相关的错误信息。
LoadRunner 是一个用于对应用程序进行压力测试和性能测试的工具。
这个错误信息通常意味着在初始化录制(record)过程中出现了问题。
这个错误可能由多种原因引起,以下是一些可能的原因和相应的解决方法:1.配置问题:确保你的LoadRunner 配置是正确的。
检查代理设置、端口号等是否与实际应用相匹配。
2.环境问题:可能的应用程序或服务器环境问题,如防火墙设置、网络连接等。
确保目标服务器和应用可以正常访问,并且没有任何阻止LoadRunner 录制或与目标服务器通信的防火墙或安全设置。
3.版本兼容性:确保你的LoadRunner 版本与目标应用程序或服务器版本兼容。
4.权限问题:确保你有足够的权限来录制目标应用程序或服务器。
有时,特定的权限或角色设置可能会阻止LoadRunner 正常录制。
5.路径问题:检查录制的脚本保存路径是否存在,是否有足够的空间存储录制的内容。
6.其他工具冲突:确保没有其他工具或应用与LoadRunner 冲突,或占用了LoadRunner 需要使用的端口号等资源。
7.查看日志:检查LoadRunner 的日志文件,这通常可以提供更多关于错误原因的详细信息。
8.重新安装或修复:考虑重新安装LoadRunner 或修复安装,有时这可以解决一些未知的初始化问题。
9.联系支持:如果以上方法都不能解决问题,建议联系LoadRunner 的技术支持或查阅相关的官方文档和论坛,寻求更专业的帮助。
记住,处理此类问题时,通常需要具体分析每个环境的特定情况,因此以上提供的只是一些常见的解决方法,而不是绝对的解决方案。
loadrunner录制脚步时的问题
资料还未整理,有时间我会尽快把他整理好的,希望大家也能把自己遇到的新问题和解决方法放到这里面来,供大家交流和学习。
问题1:vuser_init.c1错误-26612: 对于“/sa.aspx?id=353508940'+yesdata+'”,HTTP 状态代码=500 (Internal Server Error) [MsgId: MERR-26612]?解决解决办法:/sa.aspx?id=353508940'+yesdata+'服务器错误(漏掉一个参数)LoadRunner脚本回放问题及解决在运行脚本回放过程中,有时会出现错误,这在实际测试中是不可避免的,毕竟自动录制生成的脚本难免会有问题,需要运行脚本进行验证,把问题都解决后才加入到场景中进行负载测试。
下面结合常用的协议(如Web、Web Services协议)录制的脚本进行回放时出现的问题介绍一下解决的方法。
需要注意的是,回放脚本时出现的错误有时是程序自身的原因导致的,因此在解决脚本回放问题前必须保证程序录制出的脚本是正确的。
1.LoadRunner超时错误:在录制Web协议脚本回放时超时情况经常出现,产生错误的原因也有很多,解决的方法也不同。
错误现象1:Action.c(16): Error -27728: Step download timeout (120 seconds) has expired when downloading non-resource(s)。
错误分析:对于HTTP协议,默认的超时时间是120秒(可以在LoadRunner中修改),客户端发送一个请求到服务器端,如果超过120秒服务器端还没有返回结果,则出现超时错误。
解决办法:首先在运行环境中对超时进行设置,默认的超时时间可以设置长一些,再设置多次迭代运行,如果还有超时现象,需要在“Runtime Setting”>“Internet Protocol:Preferences”>“Advanced”区域中设置一个“winlnet replay instead of sockets”选项,再回放是否成功。
Load Runner常见问题
Load Runner常见问题----翁春芳在刚开始学习使用loadrunner进行性能测试时,经常碰到一些问题,比如录制脚本经常遇到不能打开浏览器的情况,到了后期对测试结果又经常不明白是什么原因导致失误失败,于是就自己上网查寻找些解决方法并记录下来,留以后备用也供大家参考。
其中有些问题和是我现在还没碰到的,不过若将来更深一步学习和使用lr,应该也会有用。
就一并记录下来。
1、LoadRunner录制脚本时为什么不会弹出IE浏览器?当一台主机上安装多个浏览器时,LoadRunner录制脚本经常遇到不能打开浏览器的情况,可以启动浏览器,打开Internet选项对话框,切换到高级标签,去掉“启用第三方浏览器扩展(需要重启动)”的勾选,然后再次运行VuGen即可解决问题。
提示:通常安装Firefox等浏览器后,都会勾选上面得选项,导致不能正常录制。
因此建议运行LoadRunner得主机上保持一个干净的测试环境。
2、录制Web脚本时,生成的脚本中存在乱码该如何解决?录制脚本前,打开录制选项配置对话框Record-Options,进入到Advanced标签,先勾选“Support charset”,然后选择中支持UTF-8。
再次录制,就不会出现中文乱码问题了。
3、回放乱码,IE访问页面一切正常,但是LR回放时在run viewer中显示的页面为乱码?这一问题一般是由于页面保存时的编码格式和页面中的charset格式不一致引起的(html头中通常会有<meta http-equiv="Content-Type" c>)。
遇到这类问题,只需要将页面做另存为,将保存的编码格式和页面中的charset格式统一起来就可以了。
引起问题的原因是:IE浏览器解码时会优先考虑文件的保存编码格式,而后考虑页面中的charset格式,(正常情况下两者是一致的),而run viewer是直接使用页面中的charset 格式打开的。
LoadRunner脚本录制常见问题整理
LoadRunner脚本录制常见问题整理1.LoadRunner录制脚本时为什么不弹出IE浏览器?当一台主机上安装多个浏览器时,LoadRunner录制脚本经常遇到不能打开浏览器的情况,可以用下面的方法来解决。
启动浏览器,打开Internet选项对话框,切换到高级标签,去掉“启用第三方浏览器扩展(需要重启动)”的勾选,然后再次运行VuGen 即可解决问题提示:通常安装Firefox等浏览器后,都会勾选上面得选项,导致不能正常录制。
因此建议运行LoadRunner得主机上保持一个干净的测试环境。
1.Loadrunner录制脚本时无法正确打开IE或打开IE时无响应进行如下设置可排除问题:1、设置默认浏览器为IE;2、IE已禁用第三方浏览器扩展;3、Loadrunner中Run-time Setting 的User-agent设置正确;4、Start Recording中IE路径和Program to record也正确。
2.录制Web脚本时,生成的脚本中存在乱码该如何解决?录制脚本前,打开录制选项配置对话框Record-Options,进入到Advanced标签,先勾选“Support charset”,然后选择中支持UTF-8。
再次录制,就不会出现中文乱码问题了。
3.HTML-based script与URL-based script的脚本有什么区别?使用“HTML-based script”的模式录制脚本,VuGen为用户的每个HTML操作生成单独的步骤,这种脚本看上去比较直观;使用“URL-based script”模式录制脚本时,VuGen可以捕获所有作为用户操作结果而发送到服务器的HTTP请求,然后为用户的每个请求分别生成对应方法。
通常,基于浏览器的Web应用会使用“HTML-based script”模式来录制脚本;而没有基于浏览器的Web应用、Web应用中包含了与服务器进行交互的Java Applet、基于浏览器的应用中包含了向服务器进行通信的JavaScript/VBScript代码、基于浏览器的应用中使用了HTTPS 安全协议,这时使用“URL-based script”模式进行录制。
LoadRunner出现error问题及解决方法总结
LoadRunner出现error问题及解决方法总结一、Step download timeout (120 seconds)这是一个经常会遇到的问题,解决得办法走以下步骤:1、修改run time setting中的请求超时时间,增加到600s,其中有三项的参数可以一次都修改了,HTTP-request connect timeout,HTTP-request receieve timeout,Step download timeout,分别建议修改为600、600、5000;run time setting设置完了后记住还需要在control组件的option的run time setting中设置相应的参数;2、办法一不能解决的情况下,解决办法如下:设置runt time setting中的internet protocol-preferences中的advaced区域有一个winlnet replay instead of sockets选项,选项后再回放就成功了。
切记此法只对windows系统起作用,此法来自zee的资料。
二、问题描述Connection reset by peer这个问题不多遇见,一般是由于下载的速度慢,导致超时,所以,需要调整一下超时时间。
解决办法:Run-time setting窗口中的‘Internet Protocol’-‘Preferences’设置set advanced options(设置高级选项),重新设置一下“HTTP-request connect timeout(sec),可以稍微设大一些”;三、问题描述connection refused这个的错误的原因比较复杂,也可能很简单也可能需要查看好几个地方,解决起来不同的操作系统方式也不同;1、首先检查是不是连接weblogic服务过大部分被拒绝,需要监控weblogic的连接等待情况,此时需要增加acceptBacklog,每次增加25%来提高看是否解决,同时还需要增加连接池和调整执行线程数,(连接池数*Statement Cache Size)的值应该小于等于oracle数据库连接数最大值;2、如果方法一操作后没有变化,此时需要去查看服务器操作系统中是否对连接数做了限制,AIX下可以直接vi文件limits修改其中的连接限制数,还有tcp连接等待时间间隔大小,wiodows类似,只不过wendows修改注册表,具体修改方法查手册,注册表中有TcpDelayTime项;四、问题描述open many files问题一般都在压力较大的时候出现,由于服务器或者应用中间件本身对于打开的文件数有最大值限制造成,解决办法:1、修改操作系统的文件数限制,aix下面修改limits下的nofiles 限制条件,增大或者设置为没有限制,尽量对涉及到的服务器都作修改;2、方法一解决不了情况下再去查看应用服务器weblogic的commonEnv.sh文件,修改其中的nofiles文件max-nofiles数增大,应该就可以通过了,具体就是查找到nofiles方法,修改其中else条件的执行体,把文件打开数调大;修改前记住备份此文件,防止修改出错;五、问题描述has shut down the connection prematurely一般是在访问应用服务器时出现,大用户量和小用户量均会出现;来自网上的解释:1> 应用访问死掉小用户时:程序上的问题。
loadrunner面试问题
问题1:LoadRunner响应时间是什么?答:响应时间就是客户端发送请求,服务器返回最后(或者第)一个字节的时间。
LoadRunner的事务函数功能是度量客户端和服务器之间交互时间的。
事务函数最后在分析图表里有,比如你在前边开发脚本的时候你在登陆功能中添加了事务函数,那么controller中运行1000个用户之后,在分析图表中你就会看到1000个用户登录功能所消耗的时间(平均,其中1000个用户用的最多的时间,10000个用户用的最少的时间)。
问题2:页面点击数与页面浏览数什么概念,页面点击数过高会对系统的性能产生什么影响?答:页面点击数:又名“hits”,它包括了点击了某个网页后,浏览器为了显示此网页而附带来的所有图片等支持文件的数量。
“点击数”往往被用来衡量网站服务器的工作负载,也是衡量网站服务器性能的标准之一。
文件数量的增多,会增加网络流量。
页面浏览量(页面量):又名“PageView”,它是指实际被点击的网页数量。
“页面浏览量”往往被用来衡量网站内容的受欢迎程度和被访问情况。
问题3:在LoadRunner中有个Anget,这个Anget具体起什么作用啊?在讲Robot的架构的时候好像也提到过,但是没有讲Anget具体作用,是不是LR与Robot中Anget作用一样的呢?答:Agent 的作用是提供一个宿主环境提供虚拟用户运行,在LoadRunner中叫做Load Generator。
问题4:这个章节中讲到了“响应时间”、“页面点击数”、“吞吐量”这几个概念,我想问一下,“响应时间”越快是不是就越好?“页面点击数”越少是不是就越好?“吞吐量”越大是不是就越好?答:性能是寻找执行效率与功能之间的平衡。
这些不过是性能分析所关注的。
不是越大越好。
问题5:loadrunner如何选择协议?答:首先要熟悉应用程序的架构,采用什么协议进行通讯的.因为LoadRunner主要是通过捕获客户端与服务器之间的数据通讯包,根据这些数据包来生成脚本的.所以,如果协议选择不正确的话,LoadRunner就无法捕获客户端与服务器之间的数据通讯包。
loruner全问题解决方案
l o r u n e r全问题解决方案 The Standardization Office was revised on the afternoon of December 13, 2020loadrunner的几种常见错误及解决办法1录制loadrunner脚本时,无法生成脚本,录制过程中事物都有显示,我把所有防火墙和网络保护都关了,但是脚本就是无法生成,协议之类的都是对的。
解决:、在录制选项option->network->ort Mapping 中的Capture levet选择Socket level and WinNet level data试试2在回放脚本时出现的错误Action.c(33): Error -35061: No match found for the requested parameter "CorrelationParameter_1". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, useweb_set_max_html_param_len to increase the parameter size [MsgId: MERR-35061]解决方法:可以用web_set_max_html_param_len增加参数长度,我试过到99999999共8位;还有,你可以在web_reg_save_param_ex("ParamName=CorrelationParameter_3","LB=c","RB=>\n<table border",后面加上 "NotFound=warning", 保存编译下,就不回再提是错误了。
loadrunner回放脚本常见问题及解决方法
这时在tree view中看不到此组件的相关URL。
错误分析:所选择的录制脚本模式不正确,通常情况下,基于浏览器的Web应用会使用“HTML-based scrīpt”模式来录制脚本;而没有基于浏览器的Web应用、Web应用中包含了与服务器进行交互的JavaApplet、基于浏览器的应用中包含了向服务器进行通信的Javascrīpt/VBscrīpt代码、基于浏览器的应用中使用HTTPS安全协议,这时则使用“URL-based scrīpt”模式进行录制。
错误现象:利用LoadRunner 8.0版本来录制Web Services协议的脚本没有任何错误提示,回放脚本时会出现如下错误提示“Error:server returned an incorrectly formatted SOAP response”。
错误分析:出现此错误的原因是LoadRunner8.0在录制Web Services协议的脚本时存在一个缺陷:如果服务器的操作系统是中文的,VuGen会自动将WSDL文件的头改为<?xml version="1.0"encoding="zh_cn" ?>,所以才会有此错误提示。
解决办法:重新录制脚本,在录制脚本前,打开录制选项配置对话框进行设置,在“Recording Options”的“Advanced”选项里先将“Surport Charset”选中,然后选中支持“UTF-8”的选项。
3.LoadRunner HTTP服务器状态代码:在录制Web协议脚本回放脚本的过程中,会出现HTTP服务器状态代码,例如常见的页面-404错误提示、-500错误提示。
1,这里的TcpTimedWaitDelay默认值应该中是30s,所以这里,把这个值调小为5s(按需要调整)。
【LoadRunner12】基础使用教程:录制第一个脚本(包含遇到的错误问题解决)
【LoadRunner12】基础使⽤教程:录制第⼀个脚本(包含遇到的错误问题解决)1、双击“Virtual User Generator”2、点击“File-New Script and Solution”,弹出如下界⾯3、选择VuGen→Single Protocol→Web-HTTP/HTML,输⼊脚本名称,选择保存位置,点击“Create”4、双击左边栏中的“vuser_init”,再点击1或者2位置处的录制按钮“Record”5、选择运⾏的浏览器、输⼊测试⽤的url,选择⼯作⽬录点击“Start Recording”5.1点击RecordingOptions5.2、选中URL-dased script5.3、勾选UTF-8和倒数第⼆个6、点击“Yes”7、会⾃动打开⽹页,如下图8、点击“插⼊开始事务”,如下图所⽰图标,输⼊名称后点击“OK”9、⽹页上输⼊账号和密码登录后,点击"插⼊结束事务",如下图所⽰图标10、点击”结束录制“按钮11、⾃动保存12、点击”Open Design Studio"13、如下图所⽰,选中的2项内容需要做参数化处理,分别选中图中2项内容,点击“Correlate”按钮,然后点击“Close”关闭弹窗15、点击“编译”按钮,编译⼀下看看是否报错16、点击回放按钮“Replay”,发现报了两个错17、第⼀个错误 Error -26547,根据错误提⽰,在如图所⽰位置添加如下代码:web_set_user("10.0.8.34\\admin","cdsf@119","10.0.8.34:28888");18、再次点击回放按钮“Replay”,只剩⼀个错误Error-2663019、错误原因,此时浏览器中,测试⽹址为登录后的状态,在浏览器中将账号退出登录,然后再次点击回放按钮“Replay”,这⼀次就通过了。
LoadRunner错误及解决方法总结
LoadRunner错误及解决方法总结1. error:missing newline in d:\loadrunner\name.dat场景执行时报error:missing newline in d:\loadrunner\name.dat第二次执行不报两个解决办法:第一:如果参数不是很多的话,不要打开记事本去编辑参数,就直接在LR提供的参数的表格中进行编辑即可。
第二:如果参数很多超过100条的话。
在记事本中编辑好了之后,记着在最后一个参数后打个回车,让鼠标的光标移动到下一行。
2.load generator is currently running the maximum number of vuser of this type使用的是loadrunner8.0,有10000个用户的web的license,global的有10个。
在测试的时候发现running vuser到达1000以后就不能再提高,后面的vuser就会出错。
错误是“The load generator is currently running the maximum number of vuser of t his type”.已经可以排除是load generator机器本身资源的问题。
因为换了性能比较强的酷睿2还是同样的问题,CPU和memory都有空闲。
解决办法:在load generator中有一个Vuser limits tab,可以设置running user的最大数目。
即设置load generator----Details------Vuser limits ----Other Vusers 的最大参数3.LoadRunner 常见问题:(1)sofeware caused connction:这种情况,一般是脚本有问题,或者loadrunner有问题。
解决方法:重新启动机器,或者重新录制脚本,估计是loadrunner的bug。
LoadRunner录制及回放常见问题
目录LoadRunner常见问题及其解决方案 (2)一、录制脚本常见问题 (2)1、LoadRunner录制脚本时为什么不弹出IE浏览器? (2)2、录制Web脚本时,生成的脚本中存在乱码该如何解决? (3)3、HTML-based script与URL-based script的脚本有什么区别? (4)4、为什么脚本中添加了检查方法Web-find,但是脚本回放时却没有执行? (4)5、运行时的Pacing设置主要影响什么? (5)6、运行时设置Log标签中,如果没有勾选“Enable logging”,则手工消息可以发送吗? (5)7、LoadRunner 8.0版本的VuGen在录制Web Services协议的脚本时一切正常,而回放时报出错误提示“Error:server returned an incorrectly formatted SOAP response”。
这时说明原因引起的? (6)8、VuGen支持Netscape的客户证书吗? (6)9、VuGen会修改录制浏览器中的代理服务器设置吗? (6)10、在LoadRunner脚本如何输出当前系统时间? (6)11、一些Web虚拟用户脚本录制后立刻回放没有任何问题,但是当设置迭代次数大于1时,如果进行回放则只能成功迭代一次。
为什么从第二次迭代开始发生错误? (7)12、虚拟客户脚本“Run-time Setting”中的线程和进程运行方式的区别? (7)13、在Controller中运行Web相关测试场景时,经常会有很多超时错误提示,如何处理这类问题? (8)14、为什么Windows系统中的CPU、内存等资源仍然充足,但是模拟的用户数量却上不去? (8)16、Loadrunner不支持默认的浏览器 (9)17、脚本回放时报错Extension lrwreplaymain.dll is not loaded. System error (9)LoadRunner常见问题及其解决方案一、录制脚本常见问题1、LoadRunner录制脚本时为什么不弹出IE浏览器?当一台主机上安装多个浏览器时,LoadRunner录制脚本经常遇到不能打开浏览器的情况,可以用下面的方法来解决。
45 个 LoadRunner 面试问题(附答案)
45 个LoadRunner 面试问题(附答案)1.What is load testing? - Load testing is to test that if the application works fine withthe loads that result from large number of simultaneous users, transactions and todetermine weather it can handle peak usage periods.2.What is Performance testing? - Timing for both read and update transactionsshould be gathered to determine whether system functions are being performed in an acceptable timeframe. This should be done standalone and then in a multi userenvironment to determine the effect of multiple transactions on the timing of a single transaction.3.Did u use LoadRunner? What version? - Yes. Version 7.2.4.Explain the Load testing process? -Step 1: Planning the test. Here, we develop a clearly defined test plan to ensure the test scenarios we develop will accomplish load-testing objectives. Step 2: Creating Vusers. Here, we create Vuser scripts that contain tasks performed by each Vuser, tasks performed by Vusers as a whole, and tasks measured as transactions. Step 3: Creating the scenario. A scenario describes the events that occur during a testing session. It includes a list of machines, scripts, and Vusers that run during the scenario.We create scenarios using LoadRunner Controller. We can create manual scenarios as well as goal-oriented scenarios. In manual scenarios, we define the number of Vusers, the load generator machines, and percentage of Vusers to be assigned to each script.For web tests, we may create a goal-oriented scenario where we define the goal that our test has to achieve. LoadRunner automatically builds a scenario for us. Step 4: Running the scenario.We emulate load on the server by instructing multiple Vusers to perform taskssimultaneously. Before the testing, we set the scenario configuration and scheduling.We can run the entire scenario, Vuser groups, or individual Vusers. Step 5:Monitoring the scenario.We monitor scenario execution using the LoadRunner online runtime, transaction,system resource, Web resource, Web server resource, Web application server resource, database server resource, network delay, streaming media resource, firewall server resource, ERP server resource, and Java performance monitors. Step 6: Analyzing test results. During scenario execution, LoadRunner records the performance of the application under different loads. We use Loa dRunner‟s graphs and reports to analyze the application‟s performance.5.When do you do load and performance Testing? - We perform load testing oncewe are done with interface (GUI) testing. Modern system architectures are large and complex. Whereas single user testing primarily on functionality and user interface of a system component, application testing focuses on performance and reliability of an entire system. For example, a typical application-testing scenario might depict 1000 users logging in simultaneously to a system. This gives rise to issues such as what is the response time of the system, does it crash, will it go with different softwareapplications and platforms, can it hold so many hundreds and thousands of users, etc.This is when we set do load and performance testing.6.What are the components of LoadRunner? - The components of LoadRunner areThe Virtual User Generator, Controller, and the Agent process, LoadRunner Analysis and Monitoring, LoadRunner Books Online.7.What Component of LoadRunner would you use to record a Script? - The VirtualUser Generator (VuGen) component is used to record a script. It enables you todevelop Vuser scripts for a variety of application types and communication protocols.8.What Component of LoadRunner would you use to play Back the script inmulti user mode? - The Controller component is used to playback the script inmulti-user mode. This is done during a scenario run where a vuser script is executed bya number of vusers in a group.9.What is a rendezvous point? - You insert rendezvous pointsinto Vuser scripts toemulate heavy user load on the server. Rendezvous pointsinstruct Vusers to wait during test execution for multiple Vusers to arrive at a certain point, in order that they may simultaneously perform a task. For example, to emulate peak load on the bank server, you can insert a rendezvous point instructing 100 Vusers to deposit cash into their accounts at the same time.10.What is a scenario? - A scenario defines the events that occur during each testingsession. For example, a scenario defines and controls the number of users to emulate, the actions to be performed, and the machines on which the virtual users run their emulations.11.Explain the recording mode for web Vuser script? - We use VuGen to develop aVuser script by recording a user performing typical business processes on a client application. VuGen creates the script by recording the activity between the client and the server. For example, in web based applications, VuGen monitors the client end of the database and traces all the requests sent to, and received from, the database server. We use VuGen to: Monitor the communication between the application and the server; Generate the required function calls; and Insert the generated function calls into a Vuser script.12.Why do you create parameters? - Parameters are like script variables. They areused to vary input to the server and to emulate real users. Different sets of data are sent to the server each time the script is run. Better simulate the usage model for more accurate testing from the Controller; one script can emulate many different users on the system.13.What is correlation? Explain the difference between automatic correlationand manual correlation? - Correlation is used to obtain data which are unique for each run of the script and which are generated by nested queries. Correlation provides the value to avoid errors arising out of duplicate values and also optimizing the code (to avoid nested queries). Automatic correlation is where we set some rules for correlation.It can be application server specific. Here values are replaced by data which arecreated by these rules. In manual correlation, the value we want to correlate is scanned and create correlation is used to correlate.14.How do you find out where correlation is required? Give few examples fromyour projects? - Two ways:First we can scan for correlations, and see the list of values which can becorrelated. From this we can pick a value to be correlated. Secondly,we can record two scripts and compare them. We can look up the difference file to see for the values which needed to be correlated. In my project, there was a unique id developed for each customer, it was nothing but Insurance Number, it was generated automatically and it was sequential and this value was unique. I had to correlate this value, in order to avoid errors while running my script. I did using scan for correlation.15.Where do you set automatic correlation options? - Automatic correlation fromweb point of view can be set in recording options and correlation tab. Here we can enable correlation for the entire script and choose either issue online messages or offline actions, where we can define rules for that correlation. Automatic correlation for database can be done using show output window and scan for correlation and picking the correlate query tab and choose which query value we want to correlate. If we know the specific value to be correlated, we just do create correlation for the value and specify how the value to be created.16.What is a function to capture dynamic values in the web Vuser script? -Web_reg_save_param function saves dynamic data information to a parameter.17.When do you disable log in Virtual User Generator, When do you choosestandard and extended logs? - Once we debug our script and verify that it isfunctional, we can enable logging for errors only. When we add a script to a scenario, logging is automatically disabled.Standard Log Option:When you selectStandard log, it creates a standard log of functions and messages sent during script execution to use for debugging. Disable this option for large load testing scenarios.When you copy a script to a scenario, logging is automatically disabledExtended Log Option: Selectextended log to create an extended log, including warnings and other messages.Disable this option for large load testing scenarios. When you copy a script to a scenario, logging is automatically disabled. We can specify which additional information should be added to the extended log using the Extended log options.18.How do you debug a LoadRunner script? - VuGen contains two options to helpdebug Vuser scripts-the Run Step by Step command and breakpoints. The Debug settings in the Options dialog box allow us to determine the extent of the trace to be performed during scenario execution. The debug information is written to the Output window. We can manually set the message class within your script using thelr_set_debug_message function. This is useful if we want to receive debug information about a small section of the script only.19.How do you write user defined functions in LR? Give me few functions youwrote in your previous project? - Before we create the User Defined functions we need to create the externallibrary (DLL) with the function. We add this library to VuGen bin directory. Once the library is added then we assign user defined function as a parameter. The function should have the following format: __declspec (dllexport) char* <functionname>(char*, char*)Examples of user defined functions are as follows:GetVersion, GetCurrentTime, GetPltform are some of the user defined functions used in my earlier project.20.What are the changes you can make in run-time settings? - The Run TimeSettings that we make are: a) Pacing - It has iteration count. b) Log - Under this we have Disable Logging Standard Log and c) ExtendedThink Time - In think time we have two options like Ignore think time and Replay think time. d) General - Under general tab we can set the vusers as process or as multithreading and whether each step as a transaction.21.Where do you set Iteration for Vuser testing? - We set Iterations in the Run TimeSettings of the VuGen. The navigation for this is Run time settings, Pacing tab, set number of iterations.22.How do you perform functional testing under load? - Functionality under load canbe tested by running several Vusers concurrently. By increasing the amount of Vusers, we can determine how much load the server can sustain.23.What is Ramp up? How do you set this? - This option is used to gradually increasethe amount of Vusers/load on the server. An initial value is set and a value to wait between intervals can bespecified. To set Ramp Up, go to …Scenario Scheduling Options‟24.What is the advantage of running the Vuser as thread? - VuGen provides thefacility to use multithreading. This enables more Vusers to be run pergenerator. If the Vuser is run as a process, the same driver program is loaded into memory for each Vuser, thus taking up a large amount of memory. This limits the number of Vusers that can be run on a singlegenerator. If the Vuser is run as a thread, only one instance of the driver program is loaded into memory for the given number ofVusers (say 100). Each thread shares the memory of the parent driver program, thus enabling more Vusers to be run per generator.25.If you want to stop the execution of your script on error, how do you do that?- The lr_abort function aborts the execution of a Vuser script. It instructs the Vuser to stop executing the Actions section, execute the vuser_end section and end theexecution. This function is useful when you need to manually abort a script execution as a result of a specific error condition. When you end a script using this function, the Vuser is assigned the status "Stopped". For this to take effect, we have to first uncheck the “Continue on error” option in Run-Time Settings.26.What is the relation between Response Time and Throughput? - TheThroughput graph shows the amount of data in bytes that the Vusers received from the server in a second. When we compare this with the transaction response time, we will notice that as throughput decreased, the response time also decreased. Similarly, the peak throughput and highest response time would occur approximately at the same time.27.Explain the Configuration of your systems? - The configuration of our systemsrefers to that of the client machines on which we run the Vusers. The configuration of any client machine includes its hardware settings, memory, operating system,software applications, development tools, etc. This system component configuration should match with the overall system configuration that would include the networkinfrastructure, the web server, the database server, and any other components that go with this larger system so as to achieve the load testing objectives.28.How do you identify the performance bottlenecks? - Performance Bottleneckscan be detected by using monitors. These monitors might be application servermonitors, web server monitors, database server monitors and network monitors. They help in finding out the troubled area in our scenario which causes increased response time. The measurements made are usually performance response time, throughput, hits/sec, network delay graphs, etc.29.If web server, database and Network are all fine where could be the problem?- The problem could be in the system itself or in the application server or in the code written for the application.30.How did you find web server related issues? - Using Web resource monitors wecan find the performance of web servers. Using these monitors we can analyzethroughput on the web server, number of hits per second thatoccurred during scenario, the number of http responses per second, the number of downloaded pages per second.31.How did you find database related issues? - By running “Database” monitor andhelp of “Data Resource Graph” we can find database related issues. E.g. You can specify the resource you want to measure on before running the controller and than you can see database related issues32.Explain all the web recording options?33.What is the difference between Overlay graph and Correlate graph? - OverlayGraph: It overlay the content of two graphs that shares a common x-axis. Left Y-axis on the merged g raph show‟s the current graph‟s value & Right Y-axis show the value of Y-axis of the graph that was merged. Correlate Graph: Plot the Y-axis of two graphs against each other. The active graph‟s Y-axis becomes X-axis of merged graph. Y-axis of the graph tha t was merged becomes merged graph‟s Y-axis.34.How did you plan the Load? What are the Criteria? - Load test is planned to decidethe number of users, what kind of machines we are going to use and from where they are run. It is based on 2 important documents, Task Distribution Diagram andTransaction profile. Task Distribution Diagram gives us the information on number of users for a particular transaction and the time of the load. The peak usage andoff-usage are decided from this Diagram. Transaction profile gives us the information about the transactions name and their priority levels with regard to the scenario we are deciding.35.What does vuser_init action contain? - Vuser_init action contains procedures tologin to a server.36.What does vuser_end action contain? - Vuser_end section contains log offprocedures.37.What is think time? How do you change the threshold? - Think time is the timethat a real user waits between actions. Example: When a user receives data from a server, the user may wait several seconds to review the data before responding. This delay is known as thethink time. Changing the Threshold: Threshold level is the level below which the recorded think time will be ignored. The default value is five (5)seconds. We can change the think time threshold in the Recording options of the Vugen.38.What is the difference between standard log and extended log? - The standardlog sends a subset of functions and messages sent during script execution to a log. The subset depends on the Vuser type Extended log sends a detailed script execution messages to the output log. This is mainly used during debugging when we want information about: Parameter substitution. Data returned by the server. Advanced trace.39.Explain the following functions: - lr_debug_message - The lr_debug_messagefunction sends a debug message to the output log when the specified message class is set. lr_output_message - The lr_output_message function sends notifications to the Controller Output window and the Vuser log file. lr_error_message - Thelr_error_message function sends an error message to the LoadRunner Output window.lrd_stmt - The lrd_stmt function associates a character string (usually a SQLstatement) with a cursor. This function sets a SQL statement to be processed.lrd_fetch - The lrd_fetch function fetches the next row from the result set.40.Throughput- If the throughput scales upward as time progresses and thenumber of Vusers increase, this indicates that the bandwidth is sufficient. If the graphwere to remain relatively flat as the number of Vusers increased, it would be reasonable to conclude that the bandwidth is constraining the volume ofdata delivered.41.Types of Goals in Goal-Oriented Scenario - Load Runner provides you with fivedifferent types of goals in a goal oriented scenario:1.The number of concurrent Vusers2.The number of hits per second3.The number of transactions per second4.The number of pages per minute5.The transaction response time that you want your scenarioAnalysis Scenario (Bottlenecks): In Running Vuser graph correlated with the response time graph you can see that as the number of Vusers increases, the average response time of the check itinerary transaction very gradually increases. In other words, the average response time steadily increases as the loadincreases. At 56 Vusers, there is a sudden, sharp increase in the average response time. We say that the test broke the server. That is the mean time before failure (MTBF). The response time clearly began to degrade when there were more than 56 Vusers running simultaneously.What is correlation? Explain the difference between automatic correlation and manual correlation? - Correlation is used to obtain data which are unique for each run of the script and which are generated by nested queries. Correlation provides the value to avoid errors arising out of duplicate values and also optimizing the code (to avoid nested queries). Automatic correlation is where we set some rules for correlation.It can be application server specific.Here values are replaced by data which are created by these rules. In manual correlation, the value we want to correlate is scanned and create correlation is used to correlate.Where do you set automatic correlation options? - Automatic correlation from web point of view, can be set in recording options and correlation tab. Here we can enable correlation for the entire script and choose either issue online messages or offline actions, where we can define rules for that correlation. Automatic correlation for database, can be done using show output window and scan for correlation and picking the correlate query tab and choose which query value we want to correlate. If we know the specific value to be correlated, we just do create correlation for the value and specify how the value to be created.What is a function to capture dynamic values in the web vuser script? - Web_reg_save_param function saves dynamic data information to a parameter.。
loadrunner 面试题
loadrunner 面试题LoadRunner面试题一、LoadRunner简介LoadRunner是一款功能强大的性能测试工具,可用于模拟用户的行为,测试系统的并发用户数量、响应时间等关键指标。
它被广泛应用于各种软件和网络应用的性能测试。
二、常见的LoadRunner面试题及答案问题一:什么是LoadRunner,它的主要组件有哪些?答:LoadRunner是一款由Micro Focus公司开发的性能测试工具,其主要组件包括Virtual User Generator(VUGen)、Controller、Load Generator、Analysis等。
问题二:请简要介绍LoadRunner的工作流程。
答:LoadRunner的工作流程可以分为录制脚本、设计场景、运行测试和分析结果四个主要步骤。
首先,通过VUGen录制脚本,将用户的操作转化为脚本代码。
然后,在Controller中设计并配置测试场景,包括虚拟用户数量、负载模式等。
接下来,启动测试并监控测试过程,Load Generator会模拟用户行为并发送请求。
最后,通过Analysis对测试结果进行分析和报告生成。
问题三:LoadRunner的性能测试类型有哪些?答:LoadRunner支持多种性能测试类型,常见的包括负载测试、压力测试、容量规划测试和瓶颈测试等。
负载测试主要评估系统在不同负载下的性能表现;压力测试则是通过逐渐增加负载来测试系统的极限容量;容量规划测试用于预测系统的容量需求;瓶颈测试是为了确定系统的瓶颈点。
问题四:请简要介绍LoadRunner中的虚拟用户生成器(VUGen)。
答:VUGen是LoadRunner的一个主要组件,用于录制和生成虚拟用户脚本。
它可以录制用户的操作行为,并将其转化为脚本代码,用于模拟用户的行为。
在录制期间,VUGen会生成与被测应用程序进行通信的代码,并记录相关参数和事务信息。
问题五:LoadRunner中的控制器(Controller)是用来做什么的?答:Controller是LoadRunner的一个核心组件,用于设计和管理测试场景。
LoadRunner不能录制脚本问题—转载
环境是【Windows XP,LoadRunner 8.1】方法一:关闭loadrunner和IE,在loadrunner的执行文件目录bin下找到文件register_vugen.bat,执行改文件,然后重启loadrunner,尝试录制。
方法二:一种是IE设置可能有问题。
Internet选项的高级标签页中有一个启用第三方浏览器扩展(需要重启),请不要选择改选项。
(注意:如果使用MI的QTP,这个选项需要打上勾,哈哈,很搞笑。
)方法三:loadrunner用的是8.1,经过我一而再再而三的测试,发现无法录制脚本的原因是因为适用的是IE7浏览器,换成绿色IE6之后一切正常了。
方法四:如果被测试系统在本机上,访问地址为:http://127.0.0.1:端口/程序名称,需要将URL改为:http://localhost:端口/程序名称,这样就可以产生脚本了。
这个现象我也觉得很奇怪,不知道到底为什么?但是,改成(http://localhost:端口/程序名称)的确可以产生脚本了,呵呵!方法五:开始-运行regsvr32 BHOManager.dll方法六:以前曾经在51论坛上下载了《Loadrunner问题集粹》,其中有提到《LR在2003或XPSP2安装问题.txt》,说法是:Windows 2003 & XP SP2 have a new DEP (Data Execution Prevention) feature which prevents VuGen recording.Go to Control Panel, System -> Advanced tab, Performance section "Settings" button Data Execution Prevention tab ,and add the client program or choose "Turn on DEP for essential windows programs and services only." A reboot is required.问题一:EDP数据保护问题,录制时不能自动弹出IE处理方法:如下图,购选第一种问题二:运行场景的时候,报错说录制的脚本不存在处理方法:录制好脚本后,按LR的步骤,一步一步保存,选择下图中的按钮。
LoadRunner错误集锦
LoadRunner出现error问题及解决方法总结 一、Step download timeout (120 seconds)这是一个经常会遇到的问题,解决得办法走以下步骤:1、修改run time setting中的请求超时时间,增加到600s,其中有三项的参数可以一次都修改了,HTTP‐request connect timeout,HTTP‐request receieve timeout,Step download timeout,分别建议修改为600、600、5000。
run time setting设置完了后记住还需要在control组件的option的run time setting中设置相应的参数。
2、办法一不能解决的情况下,解决办法如下:设置runt time setting中的internet protocol‐preferences中的advaced区域有一个winlnet replay instead of sockets选项,选项后再回放就成功了。
切记此法只对windows系统起作用,此法来自zee的资料。
二、Connection reset by peer.这个问题不多遇见,一般是由于下载的速度慢,导致超时,所以,需要调整一下超时时间。
解决办法:Run‐time setting窗口中的‘Internet Protocol’-‘Preferences’设置set advanced options(设置高级选项),重新设置一下“HTTP‐request connect timeout(sec),可以稍微设大一些”。
三、connection refused这个的错误的原因比较复杂,也可能很简单也可能需要查看好几个地方,解决起来不同的操作系统方式也不同。
1、首先检查是不是连接weblogic服务过大部分被拒绝,需要监控weblogic的连接等待情况,此时需要增加acceptBacklog,每次增加25%来提高看是否解决,同时还需要增加连接池和调整执行线程数,(连接池数*Statement Cache Size)的值应该小于等于oracle数据库连接数最大值。
LoadRunner错误及解决方法
LoadRunner错误及解决方法[转]分类:性能测试一、Step download timeout (120 seconds)这是一个经常会遇到的问题,解决得办法走以下步骤:1、修改run time setting中的请求超时时间,增加到600s,其中有三项的参数可以一次都修改了,HTTP-request connect timeout,HTTP-request receieve timeout,Step download timeout,分别建议修改为600、600、5000;run time setting设置完了后记住还需要在controler组件的option的run time setting中设置相应的参数;2、办法一不能解决的情况下,解决办法如下:设置runt time setting中的internet protocol-preferences中的advaced区域有一个winlnet replay instead of sockets选项,选项后再回放就成功了。
切记此法只对windows系统起作用。
二、问题描述Connection reset by peer这个问题不多遇见,一般是由于下载的速度慢,导致超时,所以,需要调整一下超时时间。
解决办法:Run-time setting窗口中的‘Internet Protocol’-‘Preferences’设置set advanced options (设置高级选项),重新设置一下“HTTP-request connect timeout(sec),可以稍微设大一些”;三、问题描述connection refused这个的错误的原因比较复杂,也可能很简单也可能需要查看好几个地方,解决起来不同的操作系统方式也不同;1、首先检查是不是连接weblogic服务过大部分被拒绝,需要监控weblogic的连接等待情况,此时需要增加acceptBacklog,每次增加25%来提高看是否解决,同时还需要增加连接池和调整执行线程数,(连接池数*Statement Cache Size)的值应该小于等于oracle数据库连接数最大值;2、如果方法一操作后没有变化,此时需要去查看服务器操作系统中是否对连接数做了限制,AIX 下可以直接vi文件limits修改其中的连接限制数,还有tcp连接等待时间间隔大小,wiodows类似,只不过wendows修改注册表,具体修改方法查手册,注册表中有TcpDelayTime项;四、问题描述open many files问题一般都在压力较大的时候出现,由于服务器或者应用中间件本身对于打开的文件数有最大值限制造成,解决办法:1、修改操作系统的文件数限制,aix下面修改limits下的nofiles限制条件,增大或者设置为没有限制,尽量对涉及到的服务器都作修改;2、方法一解决不了情况下再去查看应用服务器weblogic的commonEnv.sh文件,修改其中的nofiles 文件max-nofiles数增大,应该就可以通过了,具体就是查找到nofiles方法,修改其中else条件的执行体,把文件打开数调大;修改前记住备份此文件,防止修改出错;五、问题描述has shut down the connection prematurely一般是在访问应用服务器时出现,大用户量和小用户量均会出现;来自网上的解释:1> 应用访问死掉小用户时:程序上的问题。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1.LoadRunner录制脚本时为什么不弹出IE浏览器? 当一台主机上安装多个浏览器时,LoadRunner录制脚本经常遇到不能打开浏览器的情况,可以用下面的方法来解决。
启动浏览器,打开Internet选项对话框,切换到高级标签,去掉“启用第三方浏览器扩展(需要重启动)”的勾选,然后再次运行VuGen 即可解决问题提示:通常安装Firefox等浏览器后,都会勾选上面得选项,导致不能正常录制。
因此建议运行LoadRunner得主机上保持一个干净的测试环境。
1.Loadrunner录制脚本时无法正确打开IE或打开IE时无响应进行如下设置可排除问题:1、设置默认浏览器为IE;2、IE已禁用第三方浏览器扩展;3、Loadrunner中Run-time Setting 的User-agent设置正确;4、Start Recording中IE路径和Program to record也正确。
2.录制Web脚本时,生成的脚本中存在乱码该如何解决? 录制脚本前,打开录制选项配置对话框Record-Options,进入到Advanced标签,先勾选“Support charset”,然后选择中支持UTF-8。
再次录制,就不会出现中文乱码问题了。
3.HTML-based script与URL-based script的脚本有什么区别? 使用“HTML-based script”的模式录制脚本,VuGen为用户的每个HTML操作生成单独的步骤,这种脚本看上去比较直观;使用“URL-based script”模式录制脚本时,VuGen可以捕获所有作为用户操作结果而发送到服务器的HTTP请求,然后为用户的每个请求分别生成对应方法。
通常,基于浏览器的Web应用会使用“HTML-based script”模式来录制脚本;而没有基于浏览器的Web应用、Web应用中包含了与服务器进行交互的Java Applet、基于浏览器的应用中包含了向服务器进行通信的JavaScript/VBScript代码、基于浏览器的应用中使用了HTTPS 安全协议,这时使用“URL-based script”模式进行录制。
4.为什么脚本中添加了检查方法Web-find,但是脚本回放时却没有执行? 由于检查点功能会耗费一定的资源,因此LoadRunner默认关闭了对文本及图像的检查。
要想开启检查功能,必须修改运行时的配置Run-time Setting。
进入“Run-time Setting”对话框,依次进入“InternetProtocol→Preferences”,勾选Checks下的“Enable Image and text check”选项即可。
检查执行结果时推荐使用web_reg_find方法。
5.运行时的Pacing设置主要影响什么? Pacing主要用来设置重复迭代脚本的间隔时间。
共有三种方法:上次迭代结束后立刻开始、上次迭代结束后等待固定时间、按固定或随机的时间间隔开始执行新的迭代。
根据实际需要设置迭代即可。
通常,没有时间间隔会产生更大的压力。
6.运行时设置Log标签中,如果没有勾选“Enable logging”,则手工消息可以发送吗? Enable logging选项仅影响自动日志记录和通过lr_log_message发送的消息。
即使没有勾选,虚拟用户脚本中如果使用lr_message、lr_output_message、lr_error_message,仍然会记录其发出的消息。
7.LoadRunner 8.0版本的VuGen在录制Web Services协议的脚本时一切正常,而回放时报出错误提示“Error:server returned an incorrectly formatted SOAP response”。
这时说明原因引起的? 造成这种情况的主要原因是LoadRunner 8.0的VuGen在录制Web Service协议的脚本时存在一个缺陷:如果服务器的操作系统是中文的,VuGen会自动将WSDL文件的头改为,因此会有上面的错误提示。
解决方法:把“LR80WebservicesFPI_setup.exe”和“lrunner_web_sevices_path_1.exe 个补丁打上即可解决。
8.VuGen支持Netscape的客户证书吗? 不支持。
目前的VuGen 8.0版本中仅支持Internet Explorer的客户端证书。
录制脚本时可以先从Netscape中导出所需的证书,然后将其导入到Internet Explorer中,并确保以相同的顺序导出和导入这些证书。
而且,在每台将要录制或运行需要证书的Web Vuser脚本的计算机上都要重复执行前面的过程。
9.VuGen会修改录制浏览器中的代理服务器设置吗? 会修改。
在开始录制基于浏览器的Web Vuser脚本时,VuGen首先会启动指定的浏览器。
然后,VuGen会指示浏览器访问VuGen代理服务器。
为此,VuGen会修改录制浏览器上的代理服务器设置。
默认情况下,VuGen会立即将代理服务器设置更改为Localhost:7777。
录制之后,VuGen会将原始代理服务器设置还原到该录制浏览器中。
因此,在VuGen进行录制的过程中,不可以更改代理服务器设置,否则将无法正常进行。
10.在LoadRunner脚本如何输出当前系统时间? LoadRunner提供了char *ctime(const time_t *time)函数,调用参数为一个Long型的整数指针,用于存放返回时间的数值表示。
调用语句与返回值如下示例: typedef long time_t; Action() { time_t t; lr_message(“Time in seconds since 1/1/70:%ld\n”,time(&t)); lr_message(“System time and date: %s”,ctime(&t)); } 输出结果为: Time in seconds since 1/1/70: 1185329968 System time and date:Wed Jul 25 10:19:28 2007 11.一些Web虚拟用户脚本录制后立刻回放没有任何问题,但是当设置迭代次数大于1时,如果进行回放则只能成功迭代一次。
为什么从第二次迭代开始发生错误? 这种现象多是由于在“Run-time Setting”的“Browse Emulation”的设置中,勾选了“Simulate a new user on each iteration”及其下面的选项“Clear cache on each iteration”这两个选项的含义是每次迭代时模拟一个新的用户及每次迭代时清除缓存。
由于脚本迭代时,init和end只能执行一次,如果每次迭代都模拟一个新的用户并清除缓存,则用户登录信息将一并清除,因此迭代时可能会发生错误。
12.虚拟客户脚本“Run-time Setting”中的线程和进程运行方式的区别? 如果选择“Run Vuser as a process”,则场景运行时会为每一个虚拟用户创建一个进程;选择“Run Vuser as a thread”则将每个虚拟用户作为一个线程来运行,在任务管理器中只看到一个mmdrv.exe,这种方式的运行效率更高,能造成更大的压力,时默认选项。
另外,如果启用了IP欺骗功能,则先在Controller中选中Tools菜单下的“Expert Mode”,然后将Tools菜单下的“Options>General”标签页中的IP地址分配方式也设置为与Vuser 运行方式一致,同为线程或进程方式。
13.在Controller中运行Web相关测试场景时,经常会有很多超时错误提示,如何处理这类问题? 这主要有脚本的默认超时设置引起。
当回放Web脚本时,有时候由于服务器响应时间较长,会产生超时的错误。
这时需要修改脚本的运行时配置。
进入“Run-time Setting”对话框后,依次进入“Internet Protocol→Preference”。
然后点击“Options…”按钮,进入高级设置对话框,可以修改各类超时设置的默认值。
14.为什么Windows系统中的CPU、内存等资源仍然充足,但是模拟的用户数量却上不去? 在Windows计算机的标准设置下,操作系统的默认限制只能使用几百个Vuser,这个限制与CPU或内存无关,主要是操作系统本身规定了默认的最大线程数所导致。
要想突破Windows这个限制,须修改Windows注册表。
以Windows XP Professional为例。
(1)打开注册表后,进入注册表项HKEY_LOCAL_MACHINE中的下列关键字:System\CurrentControlSet\Control\Session Manager\SubSystems。
(2)找到Windows关键字,Windows关键字如下所示: %SystemRoot%\system32\csrss.exebjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16 SharedSection=1024,3072,512关键字的格式为xxxx,yyyy,zzz。
其中,xxxx定义了系统范围堆的最大值(以KB为单位),yyyy定义每个桌面堆得大小。
(3)将yyyy的设置从3072更改为8192(即8MB),增加SharedSection参数值。
通过对注册表的更改,系统将允许运行更多的线程,因而可以在计算机上运行更多的Vuser。
这意味着能够模拟的最大并发用户数量将不受Windows操作系统的限制,而只受硬件和内部可伸缩性限制的约束。
录制脚本为空 LR录制是客户端与服务器的数据交互,只有在有交互的时候才可以录制到脚本。
1. 交互方式不一样,通过客户端的server进行交互,在scrīpt中选择最后一个track processes created as COM local servers [选择scrīpt里的最后一个选项].2. 非客户端与服务器的交互的一种操作,在页面上点前进或后退,如果页面是从缓存中取出来的,那么也就没有和服务器数据交互,所以也录制的为空脚本。