//Body response 内容:
<; PRE>//OK[8,7,5,15,6,5,0,4,0,3,0,3,2,0,0,0,1 用web_reg_save_param取出―8,7,5,15,6,5,0,4,0,3,0,3,2,0,0,0,1‖这一段,然后用strtok函数切割出一个个数字,第四个数字就是要找的值 例如:extern char * strtok(char * string, const char * delimiters ); // Explicit declaration char separators[] = \ char * token;
lr_save_string(\
token = (char *)strtok(lr_eval_string(\ if (!token) {
lr_output_message (\ return( -1 ); }
while (token != NULL ) { // While valid tokens are returned lr_output_message (\
token = (char *)strtok(NULL, separators); // Get the next token }
23.LoadRunner没有购买webservice协议的license,只有http的,可不可以完全用http协议模拟webservice?
可以,参考:
http://blog.testsautomation.com/2009/01/web-services-performance-using-loadrunner/
http://blog.testsautomation.com/2009/05/validating-web-service-response-with-xpath/
24.在场景设置中不忽略思考时间,但是在查看响应时间的时候怎样让LR自动在响应时间里减去思考时间?
在analysis中找到了设置是否在报告中包含思考时间的地方做相应的设置即可:
25.LoadRunner在运行过程中停掉1半虚拟用户
Another issue that I‘m facing from time to time is that LoadRunner stops 50% of running users without any notification, issue, error message etc. I‘ve find out that it happens only when running with log level set to ?always send a message‘. Because of that, I suggest to run with log level set to ?Send message only when error occur‘.
26.测试RTMP协议应该在LoadRunner选择什么协议来录制?
用flex协议 有这几个函数可用:
flex_rtmp_connect Connects a client to an RTMP server and sets connection options. flex_rtmp_disconnect Disconnects a client from an RTMP server. flex_rtmp_send Sends messages to an RTMP server. flex_rtmp_receive Receives responses from an RTMP server
Flex can record and replay scripts involving RTMP (Real Time Messaging Protocol). In order to enable RTMP simulation, you must configure the recording options for the Flex protocol. To enable RTMP:
1 Open the Recording Options dialog box by selecting Tools > Recording Options or clicking the Options button in the Start Recording dialog box.
2 In the Network > Port Mapping node click Options. 3 Set the Send-Receive buffer size threshold to 1500.
27.如何在LoadRunner中运行QTP脚本?
1、运行准备:
1)勾选QTP的Tools--Options--Run的\components\
2)录制需要在lr中运行的QTP脚本,并且在QTP脚本中设置事务,Services.StartTransaction \与Services.EndTransaction \2、运行QTP脚本
在LR中运行时选择QTP脚本,为QTP脚本存放目录下文件扩展名为.usr的文件。 注:LR中运行QTP脚本时,只能有一个Vuser,否则将报错:
The load generator is currently running the maximum number of Vusers of this type
28.在LR中如何忽略Socket接收数据的验证
在LR中对Socket进行性能测试时,LR会自己判断lrs_receive回来的数据的长度,而如果长度不符的话会有时间延迟的情况(这是性能测试完全不能接受的事情),如果做到这一点呢,经过反复尝试,发现一种简单的方法(用*代替具体的长度): 类似于将: recv buf1 12 \ 改为: recv buf1 * \
一切OK。
29.LoadRunner9.5的Controller中不能添加Apache的监控
在C:\\Program Files\\HP\\LoadRunner\\dat\\online_graphs中找到
online_resource_graphs.rmd文件,修改[Apache]部分中的EnableInUI为1 参考:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1274450165814+28353475&threadId=1229523
30.VB Vuser开发ADO脚本,提示“user-defined type not defined”
想在VB Vuser写入模拟数据操作的过程,然后在VB Vuser里定义了这个全局变量 Private m_Conn As ADODB.Connection '连接对象 Private m_Reco As ADODB.Recordset '结果集
但是在VB Vuser中不识别这个对象,报出user-defined type not defined 需要在Run-Time 设置中的VBA部分把ADO的库选上
如果用VB Script虚拟用户来开发就不要,直接用CreateObject来创建ADO对象即可
31.loadrunner9.5录制脚本时出现
c:\\PROGRA~1\\MICROS~1\\office12\\Grooveutil.DLL时出错内存位置访问无效
Office2007的问题,IE加载项禁用Groove GFSBrowser Helper 组件
32.LR自带的例子端口号怎么修改?

