09-29-2009, 11:07 AM
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
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")