未来已来
老婆测试工具培训记 - LoadRunner 技巧篇 - 2
上一篇 /
下一篇 2008-08-07 17:59:06
/ 个人分类:性能测试
.命令行打开LoadRunner
在多个场景需要运行的时候,可以通过批处理循环运行场景,保存结果到指定文件夹:
bat内容:
set LR_HOME=C:\Program Files\Mercury\LoadRunner
for /L %%iScenario in (1,1,10) do "%LR_HOME%\bin\Wlrun.exe" -Run -TestPath "%LR_HOME%\scenario\memory_leak_crash.lrs" -ResultName C:\LR_Result\result%%iScenario
. 既可以验证请求的正确性又Vさ玫秸返氖奔?/FONT>
由于lr的http 200的经典错误,所以需要加入验证点,如果加入了验证点,就使事务响应时间大于实际的响应时间,如何解决呢,利用lr_waste_time解决,代码如下。
double time_elapsed, duration, waste;
merc_timer_handle_t timer;
lr_start_transaction("sampleTrans");
web_url("index.htm",
"URL=http://localhost/index.htm",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
timer = lr_start_timer();
// Do some checks the duration of which is not to be included in the transaction.
web_image_check("ImgCheck1",
"src=index_files/image002.jpg",
LAST);
web_image_check("ImgCheck2",
"src=index_files/planets.gif",
LAST);
// How long did the tests take in seconds.
time_elapsed = lr_end_timer(timer);
// Convert to millisecond.s
waste = time_elapsed * 1000;
// Remove the time the checks took from the transaction.
lr_wasted_time(waste);
lr_end_transaction("sampleTrans", LR_AUTO);
相关阅读:
- ASP.NET中常用的26个优化性能方法(z全版) (投缘, 2008-8-04)
- Web性能测试术语 (caption, 2008-8-04)
- 51Testing丛书连载:(十五)性能测试从零开始——LoadRunner入门 (51testing, 2008-8-05)
- 理解Load Average做好压力测试 (yyzc_3681, 2008-8-05)
- 将windows perfmon的图形导入到LR(转载请注明) (雪儿, 2008-8-05)
- JProfiler使用说明(转载请注明) (雪儿, 2008-8-05)
- 老婆测试工具培训记 - LoadRunner 技巧篇 - 1 (pcl2004_27, 2008-8-06)
- 基于协议应用的系统之性能测试方法讨论 (51testing, 2008-8-07)
- 第二十五期软件测试沙龙演讲资料 (fishy, 2008-8-07)
- 51Testing丛书连载:(十六)性能测试从零开始——LoadRunner入门 (51testing, 2008-8-07)
收藏
举报
TAG:
性能测试