Sign in to follow this  
Followers 0
EgoArmee

Script to measure loadtimes of Intranetpages in IE9

4 posts in this topic

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.

Share this post


Link to post
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.

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0