I have a script I've put together which a) creates an InternetExplorer object, b) navigates to a web-based interface for our in-house scheduling system, c) enters a password and selects appropriate view options. The basics of the script are as follows:
Const READYSTATE_COMPLETE = 4
Dim objExplorer
Set objExplorer = Wscript.CreateObject("InternetExplorer.Application", "objExplorer_")
objExplorer.navigate "http://url.to.scheduling.page"
While objExplorer.busy Or objExplorer.ReadyState <> READYSTATE_COMPLETE
Wscript.Sleep 50
Wend
Dim objElem
Set objElem = objExplorer.document.getElementById("password")
objElem.value = "password"
Set objElem = Nothing
objExplorer.document.getElementById("commit").Click()
While objExplorer.busy Or objExplorer.ReadyState <> READYSTATE_COMPLETE
Wscript.Sleep 50
Wend
I've been doing some testing w/ IE8 and IE9, and have found that when I script the IE object, the page HTML gets rendered incorrectly (in particular, some text is bolded/italicized). If, however, I launch IE8 or IE9 manually (not via script), the page renders properly. See below for screenshots:
IE RENDERING - MANUAL LAUNCH
SCRIPTED IE RENDERING (text bolded and italicized)
I initially suspected that this has something to do with the IE document/browser mode getting a different default value in a scripted IE object, but the HTML being rendered has a <!-- DOCTYPE html -->
declaration and (at least according to IE dev. tools), both versions are being displayed in standards mode.
Does anyone have any experience with a scripted, post-IE7 IE object rendering pages differently than a manually-launched counterpart? Would scripted and manually-launched objects report themselves in any different way (perhaps to a js function that's browser-sniffing and generating CSS on the fly?)
Any ideas appreciated.