LR安装指南
1)Loadrunner11支持的Windows环境
2)LR12支持的环境参数
LR12如果没有破解,最多支持50个Vuser。
3)Loadrunner11安装
Loadrunner11安装过程中,会提示需要以下软件;
·.NET Framework v3.5 SP1
·Microsoft WSE 2.0 SP3 Runtime
·Microsoft WSE 3.0 Runtime
·Microsoft Visual C++ 2008 Run-time Components
·Strawberry Perl 5.10.1
若不提前安装,在安装时也能依此列表进行自动下载安装。
可以在安装程序时边下载边安装,最后会提示缺少“vc2005_sp1_with_at1_fix_redist”,则在LR11安装文件\lrunner\Chs\prerequisites\vc2005_sp1_redist下的文件夹中运行安装该组件。
防火墙解除阻止HP LR11。
安装后,对试用版进行破解,网上有很多详解,这里就不再重复,请利用丰富的网络资源搜索~
3)运行LR11
开始录制示例脚本。
示例录制正常启动!
一般刚开始,Loadrunner11只能用10天,25个虚拟用户,安装后至少需要登录一次,以后会自动登录。
4)LR12安装
目前市场上LR11有破解版,能支持25个虚拟用户,但是如果不破解,不能支持录制,相比较之,LR12没有破解版,不过默认情况下,能够支持50个Vuser。由于不用破解,LR12的安装相对LR11来讲简单些,基本采用默认选项即可。
这里需要注意:
在Windows10上运行LR12时,选择“以管理员身份运行”选项打开程序。
LR常见问题解决
LR使用过程中遇到了不少问题,正是碰到这些问题,驱使着笔者解决一个又一个,积累了一些经验。这里把常见的主要问题做个摘记,希望能帮助你们避开这些问题,少走弯路,直通捷径!
问题:LR11+Win7 64位+IE8,录制event=0
原因是网站中使用LayUI框架,IE支持得不好
解决办法:win7上,安装LR12.02,不破解,用LR12录制脚本,用录制的脚本在XP上运行。
运行场景时,报error,Action.c(7):
Error: Socket descriptor not found. Hint: the problem might be solved applying the following: (1) Update Run-Time Settings to Run Vuser as a process.(2) Add the following line into mdrv.dat, [lr_socks] section: 'ExtCmdLineConc=-UsingWinInet Yes'. |
根据上述LR给出的提示,做出如下修改:
①Run-Time Settings to Run Vuser as a process
②安装文件dat下查找mdrv.dat,[lr_socks]部分加上ExtCmdLineConc=-UsingWinInet Yes
上面操作设置之后,仍然报错,停止录制,在Diagnostics下Configuration,将Web Page Diagnostics选项disable掉。
再次运行就正常了。
问题:运行报错27985,Action.c(9):
Error -27985: There is no context for HTML-based functions. A previous function may not have used "Mode=HTML" or downloaded only non-HTML page(s), or the context has been reset (e.g., due to a GUI-based function) |
解决办法:在脚本中注释掉检查点的脚本,因为检查点在回放脚本时已经验证过了,而在运行场景时不需要再检查脚本了。可以看到运行成功了!
受到网络、服务器影响,为保证测试结果的正确,需要运行场景3次,3次通过后才可以代表通过。
扩展:查看日志帮助找问题。
有时候看看replay log对调试问题还是比较有用的,例如有次脚本回放结果是正确的,但是仔细查看,会发现password字段值却取的是userId的值。
原为:
Action.c(17): Notify: Parameter Substitution: parameter "password" = "19056" |
改正之后为:
Virtual User Script started at : 2020/8/25 17:01:55 Starting action vuser_init. Web Turbo Replay of LoadRunner 12.0.0 for Windows 8; build 2739 (Nov 30 2014 23:13:05) [MsgId: MMSG-27143] Run mode: HTML [MsgId: MMSG-26993] Run-Time Settings file: "E:\LRFiles\Scripts\createuser\\default.cfg" [MsgId: MMSG-27141] Vuser directory: "E:\LRFiles\Scripts\createuser" [MsgId: MMSG-27052] Vuser output directory: "E:\LRFiles\Scripts\createuser" [MsgId: MMSG-27050] Operating system's current working directory: "e:\lrfiles\scripts\createuser" [MsgId: MMSG-27048] UTC (GMT) start date/time : 2020-08-25 09:01:55 [MsgId: MMSG-26992] LOCAL start date/time : 2020-08-25 17:01:55 [MsgId: MMSG-26991] Local daylight-Savings-Time : No [MsgId: MMSG-26990] Some of the Run-Time Settings: [MsgId: MMSG-27142] Download non-HTML resources: Yes [MsgId: MMSG-27018] Verification checks: Yes [MsgId: MMSG-27017] Convert from/to UTF-8: No [MsgId: MMSG-27016] Simulate a new user each iteration: No [MsgId: MMSG-27009] Non-critical item errors as warnings: Yes [MsgId: MMSG-27008] HTTP errors as warnings: No [MsgId: MMSG-27007] WinInet replay instead of Sockets: No [MsgId: MMSG-27006] HTTP version: 1.1 [MsgId: MMSG-27005] Keep-Alive HTTP connections: Yes [MsgId: MMSG-27004] Max self Meta refresh updates: 2 [MsgId: MMSG-27003] No proxy is used (direct connection to the Internet) [MsgId: MMSG-27171] DNS caching: No [MsgId: MMSG-27035] Simulate browser cache: Yes [MsgId: MMSG-27034] Cache URLs requiring content (e.g., HTMLs): Yes [MsgId: MMSG-27033] Additional URLs requiring content: text/xml;text/plain [MsgId: MMSG-27032] Check for newer versions every visit to the page: No [MsgId: MMSG-27031] Page download timeout (sec): 600 [MsgId: MMSG-27030] Resource Page Timeout is a Warning: No [MsgId: MMSG-27029] ContentCheck enabled: Yes [MsgId: MMSG-27028] ContentCheck script-level file: "E:\LRFiles\Scripts\createuser\LrwiAedScript.xml" [MsgId: MMSG-27027] Enable Web Page Breakdown: No [MsgId: MMSG-27026] Enable connection data points: Yes [MsgId: MMSG-27023] Process socket after reschedule: Yes [MsgId: MMSG-27022] Snapshot on error: No [MsgId: MMSG-27021] Define each step as a transaction: No [MsgId: MMSG-27020] Read beyond Content-Length: No [MsgId: MMSG-26994] Parse HTML Content-Type: TEXT [MsgId: MMSG-26999] Graph hits per second and HTTP status codes: Yes [MsgId: MMSG-26998] Graph response bytes per second: Yes [MsgId: MMSG-26997] Graph pages per second: No [MsgId: MMSG-26996] Web recorder version ID: 8 [MsgId: MMSG-26995] Ending action vuser_init. Running Vuser... Starting iteration 1. Starting action Action. Action.c(3): Rendezvous login Action.c(5): Notify: Transaction "login_transaction" started. Action.c(17): web_submit_data("login") started [MsgId: MMSG-26355] Action.c(17): Notify: Parameter Substitution: parameter "username" = "user60" Action.c(17): Notify: Parameter Substitution: parameter "password" = "123456" |
版权声明:本文出自51Testing会员投稿,51Testing软件测试网及相关内容提供者拥有内容的全部版权,未经明确的书面许可,任何人或单位不得对本网站内容复制、转载或进行镜像,否则将追究法律责任。