Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
To calculate the page load time using a user defined function
#1
Solved: 11 Years, 6 Months, 3 Weeks ago
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:

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


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

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

Forum Jump:


Users browsing this thread: 1 Guest(s)