Jump to content

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


Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...