Jump to content

Script Pauses when IE Popup Opens


Recommended Posts

Changes to new versions of IE do seem to require an update to the example. On my system, the popup title is now "Message from webpage" and the instance of the browser control is 2 for some reason instead of 1. The following works for me:

#include <IE.au3>
$oIE = _IE_Example("form")
$oSubmit = _IEGetObjByName($oIE, "submitExample")
Local $hwnd = _IEPropertyGet($oIE, "hwnd")
_IEAction($oSubmit, "focus")
;ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")
ControlSend($hwnd, "", "", "{Enter}")
; Wait for Alert window, then click on OK
WinWait("Message from webpage", "ExampleFormSubmitted")
ControlClick("Message from webpage", "ExampleFormSubmitted", "[CLASS:Button; TEXT:OK; Instance:1;]")
_IELoadWait($oIE)

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

This does not work for me. The error code returns 1 which indicates that it did work, but nothing happens and I also tried the space instead of enter. It appears IE9 is the issue. Also, my instance is 4. WinWait stops script because the box never appears. I have to use the WinActive and then Send("{ENTER}") and this works but is risky.

Any ideas?

Link to comment
Share on other sites

  • 5 months later...

Dale,

Thanks. Your suggestion of looking at the second example worked perfectly for me. I did realize the example needs to be updated for IE9. So I did that as well.

I also know this post is a bit old, but I wanted to let folks know that if you have that issue, Dales suggestion does solve it.

Thanks!

Link to comment
Share on other sites

  • 1 month later...

Hi, Dale

To the same question, how to deal with a "File open" dialog, like this:

#include <IE.au3>
$oIE = _IE_Example("form")
$oSubmit = _IEGetObjByName($oIE, "fileExample")
_IEAction($oSubmit, "click")
MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$oSubmit' & @lf & @lf & 'Return:' & @lf & $oSubmit) ;### Debug MSGBOX

when the file windows is open, the script is paused too.

when i use

_IEAction($oSubmit, "focus")
ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")

it doesn't work too.

If the script isn't paused, i think i can WinActivate(), ControlSetText() and ControlClick() to deal with that window.

so i can't figure out a method, can you help to check?

Thanks.

Link to comment
Share on other sites

It's not the same question. See my sig for suggestions for input type=file

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

  • 2 years later...

Hi Dale,

I wanna echo the same question again.

"my problem is that my code actually stops while the window is open, so anything that is being coded haults."

$oForm = _IEFormGetObjByName($oIE, "owner.iolWebServiceSubmitAction")
    $oStatus = _IEGetObjById($oForm, "statuselect")
    _IEFormElementOptionSelect($oStatus, "DISABLED", 1, "byText")

 When the above code is executed, an IE popup message appears and the script halts there unless I click on "Ok" or "Cancel" manually. Not able to automate this. I tried the 2 part of _IEAction example but of no luck. Any help is highly appreciated. Thanks.

Edited by sammy1983
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...