Jump to content

Recommended Posts

Posted

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!

Posted

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...

Posted

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}")

 

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
×
×
  • Create New...