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

Greetings monks,

I'm looking for some help with the Win32::IEAutomation distribution. I've already check some postings in the Monastery with problems that are identical to my issue, but none really helped solving my issue.

I did some research on this and I'm not sure if it's a problem with the implementation of Win32::IEAutomation or it's a bug or misconfiguration of Internet Explorer. There are some bugs in rt://Win32-IEAutomation for it, but I checked them and found nothing.

I have some HTML code with the following content:

<form name=myform> <input name="try" type=button value="Try it now" onclick="confirm('For +mat?')"> </form>

And here is the Perl related code:

use warnings; use strict; use Win32::IEAutomation; # Creating new instance of Internet Explorer my $ie = Win32::IEAutomation->new( visible => 1, maximize => 0, warnin +gs => 1 ); my $site = 'http://localhost/samba.html'; $ie->gotoURL($site); my $clicker = Win32::IEAutomation::WinClicker->new( warnings => 1 ); my $button = $ie->getButton( 'name:', 'try' ); $button->Click(1); $clicker->push_confirm_button_ok('Format?', 1); $ie->closeIE(); print "finished\n";

The problem is, if I run the code, the program will hangs forever waiting the dialog box to be click. First I thought it was a problem with the method push_confirm_button_ok, but after debugging I found that the call to $self->{element}->click method (inside Win32::IEAutomation::Element::click) was hanging until I click one of the dialog buttons

I tried checking the Internet Explorer API (SDK) for some missing configuration, but everything looks ok as the documentation explain.

My guess is that something is wrong with IE when dealing with Javascript onclick event, because if I remove the related code the button is clicked and processing continues in the next line of code without problems.

I'm considering using Win32::IEAutomation because the web application I want to automate using is based on Internet Explorer (it doesn't work fine with other browsers) and I have to deal with lot's of Javascript code. If you have any other suggestion of solution, I would be glad to hear it.

I'm using a Windows XP SP 3 with Internet Explorer 7 and Active Perl 5.10.0 in my testing machine.

Thanks in advance,

Alceu Rodrigues de Freitas Junior
---------------------------------
"You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill