Jump to content
Sign in to follow this  
Sedoc94

How to Click OK from IE Pop-up Alert?

Recommended Posts

Sedoc94

I want to make this alert in IE go away by making AutoIt press OK, but I can't manage to get it right.

This is a picture of the pop up:

Posted Image

This is the summary code from the AutoIt window (from the OK button):

>>>> Window <<<<
Title: Windows Internet Explorer
Class: #32770
Position: 425, 335
Size: 437, 159
Style: 0x94C803C5
ExStyle: 0x00010101
Handle: 0x00420414

>>>> Control <<<<
Class: Button
Instance: 1
ClassnameNN: Button1
Advanced (Class): [CLASS:Button; INSTANCE:1]
ID: 1
Text: OK
Position: 137, 93
Size: 75, 23
ControlClick Coords: 59, 16
Style: 0x50030000
ExStyle: 0x00000004
Handle: 0x007A044C

>>>> Mouse <<<<
Position: 624, 473
Cursor ID: 0
Color: 0xD6D7E7

>>>> StatusBar <<<<

>>>> Visible Text <<<<
OK
Annuleren
Are you sure you want to navigate away from this page?

You haven't finished your post yet. Do you want to leave without finishing?

Press OK to continue, or Cancel to stay on the current page.


>>>> Hidden Text <<<<

Can anybody help me? I want to do this in a way so I can have the IE window hidden.

By the way, the pop-up is not showing in the taskbar (it's internal in the IE window), so I don't think ConsoleClick, ConsoleWrite, or ConsoleSend will work. Do I maybe need to use _IEAction()?

Thanks a lot!

Edited by Sedoc94

Share this post


Link to post
Share on other sites
ileandros

If it is like that then you have to search at the source code of the page, find the button and then use _IEAction()

But i dont think its like that... Since ur using autoit info tool and u have these resaults i think you can use the commands above (ControlClick) or whatever.

If WinExists("[CLASS:] or tittle") Then
ControlClick("[CLASS:] or tittle","", "Button1","left",1)
EndIf

I feel nothing.It feels great.

Share this post


Link to post
Share on other sites
Zobengrauzis

illeandros told it right, but i know it sometimes dont work stright away,

because(i dont know if this is so still, but i have old version autoit where it is so), if u tell autoit to click something in IE, which brings up this warning window, it freezes the autoit.

if u still looking for solution (i had this issue too, so i made a workaround, and by far - its the only 1 i got working) - so

u need to make another compiled autoit script (which u will made running begore this warning occures, with RUN command or others)

this script would look like this:

$wint = "Windows Internet Explorer"
$wintt = "Are you sure you want to navigate away from this page?"
while 1
if WinExists($wint, $wintt) then Controlclick($wint, $wintt, "Button1", "LEFT", 1)
sleep(500)
wend

HTH

Edited by Melba23
Increased text size and added tags

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  

×