Measuring Web Response Times

WinTask provides several timing functions that can be used to measure the performance of the application being automated. The same functions can be used to measure web page performance.

The following script opens the WinTask web site, links to the Trial Offer web page, and clicks the Tutorial checkbox.

 

StartBrowser("IE", "www.wintask.com")

 

UsePage("WinTask - Automation software and Task Scheduler. Macro software with Macro Recorder")

ClickHTMLElement("A[INNERTEXT= 'Free Downloads']")

 

UsePage("WinTask - FREE 30 Day Trial Offer")

ClickHTMLElement("INPUT CHECKBOX[NAME= 'tutorial']")

 

CloseWindow("IEXPLORE.EXE|IEFrame|WinTask - FREE 30 Day Trial Offer - Windows Internet Explorer",2)

 

If we were interested in determining the time that it takes for the Trial Offer web page to load from the time that the Free Downloads link was clicked, the script can be modified to add timing instrumentation. The modified script below measures the response time and displays the result in a message to the user.

 

StartBrowser("IE", "www.wintask.com")

 

UsePage("WinTask - Automation software and Task Scheduler. Macro software with Macro Recorder")

 

' Both the current page and the link page start with "WinTask - ",

' force the UsePage function to wait for an exact match.

#UsePageExact = 1

 

' Suppress errors in case the page doesn't load. We don't want the

' the script to terminate early.

#IgnoreErrors = 1

 

' Reset system timer #1 and start performance timing

ResetTimer(1)

StartTimer(1)

 

' Click link to Trial Offer page.

ClickHTMLElement("A[INNERTEXT= 'Free Downloads']")

 

' Save result of function.

Ret = UsePage("WinTask - FREE 30 Day Trial Offer")

' Comment out since we're not measuring the checkbox selection.

' ClickHTMLElement("INPUT CHECKBOX[NAME= 'tutorial']")

 

' Stop system timer #1.

StopTimer(1)

 

' Check whether the page loaded, report the results either way.

If (Ret <> 0) Then

' Page failed to load, report the error.

MsgBox("Error: Trial Offer page not found")

Else

' Page loaded, report the time needed to load the page.

' System timer #1 contains the elapsed time in hundredths of a second.

MsgBox("Trial Offer page loaded in " + Str$(Timer(1)) + " hundredths of second")

EndIf

 

CloseWindow("IEXPLORE.EXE|IEFrame|WinTask - FREE 30 Day Trial Offer - Windows Internet Explorer",2)