我们能够使用loadrunner捕获页面加载时间吗?

时间:2017-09-27 09:52:53

标签: loadrunner

我尝试使用此功能

捕获页面加载时间
Action() {
 long PageLoadTime;
   lr_start_transaction("1st Load Test");       
     web_url("user_guide","URL=https://www.amazon.in/","Mode=HTML",LAST );  
     pageLoadTime=web_get_int_property(HTTP_INFO_DOWNLOAD_TIME);
     lr_output_message("----PageLoadTime of URL----: [%s]", lr_eval_string("
     {pageLoadTime}"));
   lr_end_transaction("1st Load Test", LR_AUTO);
 return 0;
}

2 个答案:

答案 0 :(得分:1)

我修复了你的代码:

Action() {
 int pageLoadTime;
   lr_start_transaction("1st Load Test");       
   web_url("user_guide","URL=https://www.amazon.in/","Mode=HTML",LAST );  
   pageLoadTime=web_get_int_property(HTTP_INFO_DOWNLOAD_TIME);
   lr_output_message("----PageLoadTime of URL----: [%d]", pageLoadTime);
   lr_end_transaction("1st Load Test", LR_AUTO);
   return 0;
}

答案 1 :(得分:-1)

请参阅lr_get_transaction_duration(),lr_get_transaction_status()和lr_get_transaction_wasted_time()