Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi all , I have written a script to automate a web app using win32::IEautomation, i am able to perform most of the operations but i am not able to automatically click the javascript alert dialog box that appears, after clicking a button on the webpage. The thing is once submit button is clicked the code doesn,t execute further and is stuck, because of which i am not able to go further. Another thing since most of the customers of app are using IE i need to perform this in IE itself. Below is the code that i am using for the problem which is not working.
use Win32::IEAutomation; use Win32::IEAutomation::WinClicker; my $clicker1 =Win32::IEAutomation::WinClicker->new(warnings => 1); #----------------------------------------------------------- code for filling other input fields of form. #------------------------------------------------------------ my $title="Message from webpage"; $ie->getButton('caption:', "Submit",1)->Click; $clicker1->alert_ok($title);
alert_ok() is the subroutine that i have added in winclicker module to click on alert window it is same as other subroutines except the subroutine name. The main issue i am facing is i am not able to goto next line of code once the button is clicked. After that the code gets stuck.
  • Comment on To automatically click javascript alert dialog box using win32::IEautomation
  • Download Code