Jump to content

Script to measure loadtimes of Intranetpages in IE9


Recommended Posts

Hello Community

I've got the task to measure the loadtimes of our Intranetpages and need a programm for that.

After a bit of searching I landed in an german Autoit forum, made a Thread and got the following script

Const $runs = 1
Const $url = "www.lima-city.de/"
#include 
_IEErrorHandlerRegister()
$oIE = _IECreate("about:blank", 1, 1, 1, 1)
Sleep(1000)
If Not _IEPropertyGet ($oIE, "statusbar") Then _IEPropertySet ($oIE, "statusbar", True)
$SinkObject = ObjEvent($oIE, "IEEvent_", "DWebBrowserEvents2") ; Ereignisse den UDFs zuweisen, beginnend mit IEEvent_$sum = 0
$sum = 0
$percent = 0
For $i = 1 To $runs
$time = TimerInit()
_IENavigate($oIE, $url, 0) ;wartet nicht
$bLoaded = False
$bStarted = False
$percent = 0
$oldPer = 999
$sOldText =''
Do
Sleep(100)
$sText = _IEPropertyGet($oIE, "statustext")
if $sText <> $sOldText Then ConsoleWrite($sText & @CRLF)
$sOldText = $sText
If StringInStr($sText, "auf") Then $bStarted = True
If $bStarted Then
If StringInStr($sText, "Fertig") Then $bLoaded = True
Sleep(100)
$sText = _IEPropertyGet($oIE, "statustext")
;ConsoleWrite("2 " & $sText & @CRLF)
If StringInStr($sText, "wird") Then $bLoaded = False
EndIf
Until $bLoaded
$sum += TimerDiff($time)
Next
MsgBox(0, "Durchschnittliche Ladezeit", "Durchschnittliche Ladezeit (" & $runs & " Läufe): " & StringFormat("%.2f", $sum / $runs / 1000) & " Sekunden")

Func IEEvent_ProgressChange($Progress, $ProgressMax)
$percent = Int(($Progress * 100) / $ProgressMax)
EndFunc ;==>IEEvent_ProgressChange

The problem is that it seems to be only working in IE8 and I need it for IE9.

If you have a completly different script that also measures loadtime of Intranetsites you are welcome to post it please.

Link to comment
Share on other sites

"It doesn't work" type posts, are not really received with applause here on the forum.

I suggest you add some details of errors, and/or failures of your script hand out if

you would like allow people to make suggestions.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

What do the guys on the german forum say about the problem with IE9?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Oh i actually thought it was a common problem

Some part of the script asks for the status of a status bar which doesnt EXIST in IE9

It produces that error in the console

"C:UsersmagifloDesktopAutoItStuffSciTe..autoit3.exe" /ErrorStdOut "C:UsersmagifloDesktopLT_v3_Intranet.au3"

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

http://www.lima-city.de/

--> COM Error Encountered in LT_v3_Intranet.au3

----> $IEComErrorScriptline = 2752

----> $IEComErrorNumberHex = 80020009

----> $IEComErrorNumber = -2147352567

----> $IEComErrorWinDescription = Unbekannter Fehler

----> $IEComErrorDescription =

----> $IEComErrorSource =

----> $IEComErrorHelpFile =

----> $IEComErrorHelpContext = 0

----> $IEComErrorLastDllError = 0

--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidObjectType

--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidObjectType

--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidObjectType

.

.

.

.

.

--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidObjectType

--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidObjectType

>Exit code: 0 Time: 58.532

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...