Hey all.
I want to ask about manipulating IE via Powershell. My goal is to write script that will automatically perform some actions in the browser (on the client side – navigate to page, perform actions, measure time between responses, etc.)
I have this little thing:
$ie = new-object -com "InternetExplorer.Application"
$ie.visible = $true
$ie.navigate("http://google.com")
Now I want to check whether the browser stopped page rendering (assuming, that google takes like 30 seconds to load).
As I checked with $ie | get-member
there is DocumentCompleted property (event), but I don’t know how to access/compare it.
How should I do that?
Or maybe I should use .NET instead COM object and initiate $ie
with [system.Windows.Forms.WebBrowser]
?
cheers
edit:
Well... $ie.busy
works, but (what maybe I haven't made clear earlier) I want to know exact moment of the page rendering competition. Checking $ie.busy
in infinite loop every second might work but I suppose it's not the best way to do that.
Let's say page is loading some time (rendering is long due to the gigantic scripts on client side). I would like how long does it take to:
- load page
- how long it will take to reload/re-render after changing some data and clicking 'Save'.