Rodger Posted February 20, 2010 Posted February 20, 2010 Hello, I have the following situation: I opened a webpage with AutIt by using the _IECreate command. When AutoIt clicks on a button within the page an alert window appears. AutoIt clicks on the YES button of the alert window and immediately anohter alert window appears. AutoIt click on the YES button on this alert window an a new page is displayed. Immediately when this page finishes displaying it, an alert window appears of which I can't get control of. Here is a part of the script: $oIE = _IECreate ("blablabla",0) _IELoadWait ($oIE) WinSetState("", "", @SW_MAXIMIZE) $ButtonGo = _IEGetObjByName ($oIE, "Accept") $hwnd = _IEPropertyGet($oIE, "hwnd") _IEAction ($ButtonGo, "focus") ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") ; Wait for Alert window: WinWait(WinGetTitle("", ""), "") Sleep(5000) ; Click on OK ControlClick(WinGetTitle("", ""), "", "[CLASS:Button; TEXT:OK; Instance:1;]") ; Wait for Alert window: WinWait(WinGetTitle("", ""), "") Sleep(5000) ; Click on OK ControlClick(WinGetTitle("", ""), "", "[CLASS:Button; TEXT:&Yes; Instance:1;]") ; wait until new page is diplayed; alert window is displayed immediately after the page is displayed _IELoadWait ($oIE) *** SCRIPT HANGS Sleep(5000) ; Click on OK ControlClick(WinGetTitle("", ""), "", "[CLASS:Button; TEXT:&Yes; Instance:1;]") Can somebody tell me what I am doing wrong? Thx, Rodger
Rodger Posted February 20, 2010 Author Posted February 20, 2010 Hello, I have the following situation: I opened a webpage with AutIt by using the _IECreate command. When AutoIt clicks on a button within the page an alert window appears. AutoIt clicks on the YES button of the alert window and immediately anohter alert window appears. AutoIt click on the YES button on this alert window an a new page is displayed. Immediately when this page finishes displaying it, an alert window appears of which I can't get control of. Here is a part of the script: $oIE = _IECreate ("blablabla",0) _IELoadWait ($oIE) WinSetState("", "", @SW_MAXIMIZE) $ButtonGo = _IEGetObjByName ($oIE, "Accept") $hwnd = _IEPropertyGet($oIE, "hwnd") _IEAction ($ButtonGo, "focus") ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") ; Wait for Alert window: WinWait(WinGetTitle("", ""), "") Sleep(5000) ; Click on OK ControlClick(WinGetTitle("", ""), "", "[CLASS:Button; TEXT:OK; Instance:1;]") ; Wait for Alert window: WinWait(WinGetTitle("", ""), "") Sleep(5000) ; Click on OK ControlClick(WinGetTitle("", ""), "", "[CLASS:Button; TEXT:&Yes; Instance:1;]") ; wait until new page is diplayed; alert window is displayed immediately after the page is displayed _IELoadWait ($oIE) *** SCRIPT HANGS Sleep(5000) ; Click on OK ControlClick(WinGetTitle("", ""), "", "[CLASS:Button; TEXT:&Yes; Instance:1;]") Can somebody tell me what I am doing wrong? Thx, Rodger I solved it .... ; wait until new page is diplayed; alert window is displayed immediately after the page is displayed Sleep(10000) ; Click on OK ControlClick(WinGetTitle("", ""), "", "[CLASS:Button; TEXT:&Yes; Instance:1;]")
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