Hi,
I have written the following function to calculate the load time for a page.
Objective: Google home page opens
Click on Google Maps link
Get StartTime
Once Google Maps page arrives, get StopTime
Difference between StopTime and StartTime is the time the page takes to
load.
Problem:
Even after the last step, the arrow is again at Step 6.It doesnt stop at the
last line,i.e at msgbox and doesnt provide me the result.
Also, the result for msgbox StartTime is empty, no value
and for SttopTime its 0..
Code/Function is:
Public Function CheckLoadTime(ByVal LnkName,ByVal BroName,ByVal PagTitle)
Browser("Bro_Google").Page("Pag_Google").Sync
Browser("Bro_Google").Page("Pag_Google").Link("name:="&LnkName).Click
wait(2)
StartTime=MercuryTimers.Timer("Timer1").Start
msgbox StartTime
Browser("name:=" & BroName).Page("title:=" & PagTitle).Sync
StopTime=MercuryTimers.Timer("Timer2").Stop
msgbox StopTime
CheckLoadTime=StopTime-StartTime
End Function
Call CheckLoadTime("Maps","Google Maps","Google Maps")
msgbox CheckLoadTime(LnkName,BroName,PagTitle)
Please help.
I appreciate it.
-Joshi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---