FernandoRD Posted April 10, 2018 Posted April 10, 2018 Hi, I´m new in autoit and I´m using it to automate a form fill. The problem I´m facing is that when confirm the data doing a ControlClick, the page pops up a confirmation window with an OK/Cancel button but the script hangs waiting interaction and the next line isn´t processed, the code is: Local $oSubmit2 = _IEGetObjById($oIE, "button_end_period_one") _IEAction($oSubmit2, "click") ======> It stops here waiting and nothing else is processed ;WinWait("CLASS:#32770", "", 10) MsgBox($MB_SYSTEMMODAL, "", "OK") Send("{ESC}") As soon as I manualy choose OK or Cancel, the scripts continues normally.... I believe the solution could be putting the _IEAction in background or something like that..... Anyone? Thanks!
FernandoRD Posted April 10, 2018 Author Posted April 10, 2018 actually the title of the topic is wrong, the problem is with _IEAction and in this piece of code I changed ControlClick to Send("{ESC}") for testing purposes...
Danp2 Posted April 10, 2018 Posted April 10, 2018 For a possible solution, take a look at the 2nd example for _IEAction in the help file. Latest Webdriver UDF Release Webdriver Wiki FAQs
FernandoRD Posted April 12, 2018 Author Posted April 12, 2018 Hello Danp2, thanks to your help, the 2nd example gave hints in how solve the problem and it is working now! Thanks! The code is: Local $hWnd = _IEPropertyGet($oIE, "hwnd") _IEAction($oSubmit2, "focus") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") ; Wait for Alert window, then click on OK WinWait("","Some Text") Send("{ENTER}")
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