Sign in to follow this  
Followers 0
PearlJamFanatic

autoIT script not able to click on the Modal dialog confirmation in IE8

3 posts in this topic

Hi,

It was working for IE6 all this while. We plan to move the application to IE8 and the script no longer works. As far as i can see WinExists is failing to resognise the modal dialog's presence. Below is the script. Thanks for reading.

#include <File.au3>
#include <IE.au3>
AutoItSetOption("WinTitleMatchMode", "2") ; set the select mode to select using substring

If $CmdLine[0] < 2 Then; Arguments are not enough
    MsgBox(0, "Error", "Supply all the arguments, Modal Dialog title (Mandatory)")
    Exit
EndIf

_FileCreate($CmdLine[2])
$file = FileOpen($CmdLine[2], 2)

;added for debug
msgbox (0,"Alert Title", $CmdLine[1])
If WinExists ($CmdLine[1]) Then
    MsgBox(0,"Alert",$CmdLine[1])
Else
    MsgBox(0,"Alert","don't exist")
    EndIf
;added for debug ends

If Not WinWait($CmdLine[1],"",30) Then ; match the window with substring
    FileWrite($file, "Confirmation/Alert Pop-Up did not appear.")
    FileClose($file)
    Exit
Else
    $title = WinGetTitle($CmdLine[1])
    If Not WinActive($title) Then WinActivate($title)
    $oIE = _IEAttach($title, "embedded")
    $sHTML = _IEBodyReadHTML($oIE)
    FileWrite($file, $sHTML)
    Send("{ENTER}")
    If WinExists($title) Then
        WinClose($title)
    EndIf
    FileClose($file)
EndIf

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Well I suppose you could just use the send command after a delay, just to make sure the dialog has popped up

is the dialog important.

Edited by SparkSoft

[center]First Ever Script/App[/center][center]Simple Battery Meter[/center]

Share this post


Link to post
Share on other sites

The title text changed from "...Web Page dialog" to "...Webpage Dialog". I guess this change will be universal and hence apply to all IE6 to IE8 migration projects. thanks for your help.

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