09-29-2009, 07:22 AM
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 3
(Browser("Bro_Google").Page("Pag_Google").Link("name:="&LnkName).Click)
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 StopTime its 0..
Code/Function is:
Saket,I am Sorry, I meant to post another issue I am facing in the same context, but I posted the old query.Sorry.
Please help.
-Joshi
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 3
(Browser("Bro_Google").Page("Pag_Google").Link("name:="&LnkName).Click)
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 StopTime its 0..
Code/Function is:
Code:
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
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)
Saket,I am Sorry, I meant to post another issue I am facing in the same context, but I posted the old query.Sorry.
Please help.
-Joshi