51Testing软件测试论坛

标题: 如何在LR中得到响应时间 [打印本页]

作者: eric_mao    时间: 2015-5-14 22:07
标题: 如何在LR中得到响应时间
各位大神,事务持续时间可以通过lr_get_transaction_duration得到,但是响应时间如何才能得到呢?恳请各位大神给个参考,谢谢
作者: 林家小妞    时间: 2015-5-15 11:40
脚本举例

double trans_time;

int status;

lr_start_transaction ("Flight");

web_url("home;sz=234x60;tile=1;ord=977672495775323400",

          "URL=http://ad.doubleclick.net/...ord=977672495775323400",

          ..

          "Mode=URL",

          LAST);
// Get transaction time to this point

trans_time=lr_get_transaction_duration("Flight");

status = web_submit_data("flight",

"Action=http://www.mercury-tours.com/cgi-bin/tours?ITN_RESPONSE+",

"Method=POST",

"TargetFrame=",

...              

LAST);
/* End transaction with operation result - pass or fail */

if (status == 0)

lr_end_transaction("Flight", LR_PASS);

else

lr_end_transaction("Flight", LR_FAIL);

if (trans_time)

lr_output_message("The duration up to the submit is %f seconds", trans_time);

else

lr_output_message("The duration cannot be determined.");





欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2