人的差别在于业余时间,而一个人的命运决定于晚上8点到10点之间。 北京安全测试精英QQ群:164265622 北京白盒测试精英QQ群:164265999 北京性能测试精英QQ群:164266156 北京自动化测试精英群:212723528 北京软件测试精英QQ群:86920845

LoadRunner技巧小集锦(2)

上一篇 / 下一篇  2011-09-26 16:18:26 / 个人分类:性能测试

11、运行场景时提示“Step download timeout (120 seconds) has expired when downloading resource(s)”

vuser_init.c(12): Error -27728: Step download timeout (120 seconds) has expired when downloading non-resource(s)(出现个别,可以忽略)

vuser_init.c(12): Error -27727: Step download timeout (120 seconds) has expired when downloading resource(s). Set the "Step Timeout caused by resources is a warning" Run-Time Setting to Yes/No to have this message as a warning/error, respectively

如果觉得下载一个页面超过2分钟不是错误的话,可以在Run-Time设置中选择Preferences->Options,修改Step download timeout(sec)的时间

或者把“Step timeout caused by resources is a warning”设置为Yes,这样下载资源超时也只是作为警告,不作为错误提示,但是对于非资源的下载超时,则总是会提示错误的

12、用strtok函数分割字符串

需要在loadrunner里面获得“15”(下面红色高亮的部分),并做成关联参数。

//Body response内容:<BODY><; 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("1,2,3,4,5,6","str");

token = (char *)strtok(lr_eval_string("{str}"), separators); // Get the first token

if (!token) {

        lr_output_message ("No tokens found in string!");

        return( -1 );

    }

while (token != NULL ) { // While valid tokens are returned

        lr_output_message ("%s", token );

        token = (char *)strtok(NULL, separators); // Get the next token

    }

13LoadRunner没有购买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/

14、在场景设置中不忽略思考时间,但是在查看响应时间的时候怎样让LR自动在响应时间里减去思考时间?

analysis中找到了设置是否在报告中包含思考时间的地方做相应的设置即可:

15LoadRunner在运行过程中停掉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’.

17测试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.

18、如何在LoadRunner中运行QTP脚本?

  1、运行准备:

  1)勾选QTPTools--Options--Run"Alow other Mercury products to run tests and components"

  2)录制需要在lr中运行的QTP脚本,并且在QTP脚本中设置事务,Services.StartTransaction "start"Services.EndTransaction "start"

  2、运行QTP脚本

  在LR中运行时选择QTP脚本,为QTP脚本存放目录下文件扩展名为.usr的文件。

  注:LR中运行QTP脚本时,只能有一个Vuser,否则将报错:

  The load generator is currently running the maximum number of Vusers of this type

19、在LR中如何忽略Socket接收数据的验证

LR中对Socket进行性能测试时,LR会自己判断lrs_receive回来的数据的长度,而如果长度不符的话会有时间延迟的情况(这是性能测试完全不能接受的事情),如果做到这一点呢,经过反复尝试,发现一种简单的方法(*代替具体的长度)

类似于将:

recv buf1 12

"Hello, Denny"

改为:

recv buf1 *

"Hello, Denny"

一切OK

20LoadRunner9.5Controller中不能添加Apache的监控

C:\Program Files\HP\LoadRunner\dat\online_graphs中找到online_resource_graphs.rmd文件,修改[Apache]部分中的EnableInUI1

参考:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1274450165814+28353475&threadId=1229523

21VB Vuser开发ADO脚本,提示“user-defined type not defined”

想在VB Vuser写入模拟数据操作的过程,然后在VB Vuser里定义了这个全局变量


TAG:

叮当 引用 删除 hhuang3361   /   2013-05-14 16:52:12
5
啤啤的小窝 引用 删除 啤啤   /   2011-10-13 15:04:02
5
 

评分:0

我来说两句

Open Toolbar