MuffettsMan Posted November 6, 2007 Share Posted November 6, 2007 I have a site with a bad "Untrusted" ssl cert... giving a "The security certificate was issued by a company you have not chosen to trust. View the certificate to determine whether you want to trust the certifying authority" type of message...now trying to get autoit to work around this popup (because getting a handfull of users to install certs is eh.. undesirable) it seems to hang using code like:TrayTip("Web Auto: Enable...", "Attempting to login to Foo as: " & @UserName, 5, 1) $oIE = _IECreate ("https://SiteWithBadCert.net", 0, 1, 1) if @error == 0 Then ;TrayTip("Web Auto: Enable...", "Now logged in to Foo as: " & @UserName , 5, 1) Else TrayTip("CMS Auto: Enable...", "Notice: Bad Security Certificate Detected attempting to bypass...", 5, 2) Send("!y") sleep(5000) EndIfhowever from the debug output....0050: 0-0: TrayTip("Web Auto: Enable...", "Attempting to login to Foo as: " & @UserName, 5, 1) 0051: 0-0: $oIE = _IECreate ("https://SiteWithBadCert.net", 0, 1, 1)it hangs at this point unless i manually click the yes button... actually as i typed it i got a...--> IE.au3 V2.3-1 Warning from function _IELoadWait, $_IEStatus_LoadWaitTimeout 0053: 6-0: if @error == 0 Then 0056: 6-0: TrayTip("Web Auto: Enable...", "Notice: Bad Security Certificate Detected attempting to bypass...", 5, 2) 0057: 0-0: Send("!y") 0058: 0-0: sleep(5000) 0059: 0-0: EndIfso in theory if the window had still been active it would have continued is there a better way to interact with a popup like this than to now seemingly shorten the Timeout? Don't let that status fool you, I am no advanced memeber! Link to comment Share on other sites More sharing options...
MuffettsMan Posted November 6, 2007 Author Share Posted November 6, 2007 (edited) grr yah setting _IELoadWaitTimeout (15000) did cause the Alt+y blind key send to click yes and thus cause the script to continue, but thats one crude way of doing things ( esp because I had orig hoped to have all of this run invis. Edit: forgot to mention.. its WinXP running IE 6 Sp2 Edited November 6, 2007 by zhenyalix Don't let that status fool you, I am no advanced memeber! Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 6, 2007 Share Posted November 6, 2007 grr yah setting _IELoadWaitTimeout (15000) did cause the Alt+y blind key send to click yes and thus cause the script to continue, but thats one crude way of doing things ( esp because I had orig hoped to have all of this run invis. Edit: forgot to mention.. its WinXP running IE 6 Sp2 The _IECreate() function does _IELoadWait() by default. You need to background it so your script can go on and deal with the popup: TrayTip("Web Auto: Enable...", "Attempting to login to Foo as: " & @UserName, 5, 1) $oIE = _IECreate ("https://SiteWithBadCert.net", 0, 1, 0) ; Note last parmeter Do $hWin = WinGetHandle("Title of Window", "Text of Window") If Not @error Then TrayTip("CMS Auto: Enable...", "Notice: Bad Security Certificate Detected attempting to bypass...", 5, 2) ControlSend($hWin, "", "", "!y") EndIf Until _IELoadWait($oIE, 0, 100) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
MuffettsMan Posted November 6, 2007 Author Share Posted November 6, 2007 awesome.. that seemed to fix it - for some reason the Do... Until _IELoadWait($oIE, 0, 100) seemed to hang the script after dealing with the popup (till the timeout ended then the script continued perfectly) but turning loadwait off / backgrounding it to deal with the popup then just running a _IELoadWait ($oIE) seems to deal with it perfectly... thanks for the help! Don't let that status fool you, I am no advanced memeber! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now