Get-Response-Times.vbs

(LinkToClipboard)

From iMacros

Jump to: navigation, search

This script runs the Demo-Stopwatch macro to measure a web site's response times and then displays the results.

 set iim1= CreateObject ("imacros")
 iret = iim1.iimInit ("")
 iret = iim1.iimDisplay("Get Response Times Example")
 iplay = iim1.iimPlay("demo-stopwatch")
 data = iim1.iimGetLastExtract()
 errortext  = iim1.iimGetLastError()
 
 If iplay < 0 Then
     s = "The following error occurred: " +  vbCrLf + vbCrLf + errortext
     MsgBox s
     MsgBox "Now trying to analyze extracted values that we collected before the error occurred"
 End If
 
 'Get and display extracted values (= response times!)
 s =s+ "Intial page load time: "  + iim1.iimGetLastExtract(1) + " Seconds (ID Firstpage)" +vbcrlf +vbcrlf
 s =s+ "Form 1 submit time: "  + iim1.iimGetLastExtract(2) + " Seconds (ID SubmitData)" +vbcrlf +vbcrlf
 s =s+ "Online store form load time: "  + iim1.iimGetLastExtract(3) + " Seconds (ID Store1)" +vbcrlf +vbcrlf
 s =s+ "Overall macro run time: "  + iim1.iimGetLastExtract(4) + " Seconds (ID total)"  
 MsgBox s
 
 iret = iim1.iimExit
 WScript.Quit(0)
Personal tools