I need to handle Windows alert dialog,clicking leave page button in the dialog should navigate from the page. I have used AutoIT script and referenced the exe in my Java code, but when the alert is displayed I see
"exception waitforpageload : [JavaScript Error: "a.document.getElementsByTagName(...)[0].getButton is not a function"
error and browser quits. Kindly help me in fixing this. Below is the AutoIT script and Java code referencing the Exe.
AutoIT script:
WinWaitActive("MyONE - Mozilla Firefox","","1000")
Sleep(70000)
If WinExists("MyONE - Mozilla Firefox") Then
Send("{ENTER}")
EndIf
Java Code:
Thread.sleep(20000);
Runtime.getRuntime().exec("C:/TestProject - DEV/test.exe");