-1

I tried to capture the page load time using this function,

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;
}
  • Couldn't able to capture the page load time, is there any other ways to capture the page load time? Please clarify me on this – Meenakshi Sundaram Sep 27 '17 at 09:55
  • Welcome to SO. You should edit the question and add this information (rather than adding comments). – user5226582 Sep 27 '17 at 10:00
  • Please read the license agreements from both HP/Microfocus and Amazon regarding the use of Automated tools from Microfocus against sites not owned, managed or controlled by the tester and by the use of automated agents rather than the supported automation interfaces via web services. There are plenty of open source applications available if you need to experiment. Don't point performance testing tools at your neighbors website! – James Pulley Oct 06 '17 at 14:28

2 Answers2

1

I fixed your code:

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;
}
Buzzy
  • 2,905
  • 3
  • 22
  • 31
-1

see lr_get_transaction_duration(), lr_get_transaction_status() and lr_get_transaction_wasted_time()

James Pulley
  • 5,606
  • 1
  • 14
  • 14