Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
To calculate the page load time using a user defined function
#2
Solved: 11 Years, 4 Months ago
Hi Joshi,
It is causing because you have sarted a timer('Timer1' ) and stopping another timer ('Timer2').
if you have started timer1 then you should stop the same timer only.

you can use ElapsedTime method to get the time required to do the mentioned action by QTP.

the aother issue has been discussed in another thread by you - solution is use only a single statement to call you function.
if you will call it twice then obviously it will stuck at the position you mentioned

try the code below

Code:
Public Function CheckLoadTime(ByVal LnkName,ByVal BroName,ByVal PagTitle)
Browser("Google").Page("Google").Sync
Browser("Google").Page("Google").Link("name:="&LnkName).Click
wait(2)
StartTime=MercuryTimers.Timer("Timer1").Start
Browser("name:=" & BroName).Page("title:=" & PagTitle).Sync
StopTime=MercuryTimers.Timer("Timer1").Stop
CheckLoadTime=MercuryTimers("Timer1").ElapsedTime
End Function

msgbox CheckLoadTime("Maps","Google Maps","Google Maps")



Messages In This Thread
RE: To calculate the page load time using a user defined function - by Saket - 09-29-2009, 11:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error as Global Not defined while trying to retrieve value from Datatable siddharth1609 0 958 09-11-2019, 02:52 PM
Last Post: siddharth1609
  Load testing in QTP newqtp 4 7,291 01-24-2019, 11:32 AM
Last Post: sonali31
  How to get input from the user in QTP? shanthiK 10 18,561 08-07-2017, 11:34 PM
Last Post: zunebuggy
  Calling a function in a Test Script from a function library anupam4j 3 6,114 06-26-2015, 12:31 AM
Last Post: babu123
  Reporter unable to load results when objects are involved? Elimelech.Eli 2 3,789 06-01-2014, 01:37 PM
Last Post: Elimelech.Eli

Forum Jump:


Users browsing this thread: 3 Guest(s)