我们可以使用 loadrunner 捕获页面加载时间吗?

Do we able to capture the page load time using 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;
}

我修复了你的代码:

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;
}

参见 lr_get_transaction_duration()、lr_get_transaction_status() 和 lr_get_transaction_wasted_time()