Sign in to follow this  
Followers 0
Rodger

Hanging script in IE after two alert windows

2 posts in this topic

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

Share this post


Link to post
Share on other sites



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;]")

Share this post


Link to post
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
Sign in to follow this  
Followers 0