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

In reply to Win32::IEAutomation Click method and Javascript confirm function by glasswalk3r

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.