Hi monks,

I wrote a snippet in perl for Web automation:

use warnings; use strict; use Win32::IEAutomation; use Win32::IEAutomation::WinClicker; if(fork()){ #part one my $clicker = Win32::IEAutomation::WinClicker->new(); $clicker->push_button_save("File Download",50); $clicker->push_button_save("Save As",50); $clicker->push_button_yes("Save As", 50); $clicker->push_confirm_button_cancle("Download Complete",20); } else{ #part 2 Creating new instance of Internet Explorer my $ie = Win32::IEAutomation->new( visible => 1, maximize => 1); # Site navigation $ie->gotoURL('http://xxx.xxx.xxx.com/'); $ie->getTextBox('name:', "USERNAME")->SetValue("xxx"); $ie->getTextBox('name:', "PASSWORD")->SetValue("xxx"); $ie->getButton('name:', "OK")->Click; $ie->getButton('name:', "FINDBUTTON")->Click; $ie->getButton('name:', "BTNEXCEL")->Click; $ie->WaitforDone; # we will wait here for complete load }
Win32::IEAutomation::WinClicker is a wrap of autoit. I found it can't catch the window before it correctly. I trid to split above code to 2 parts and run them separately, it works fine.
but it will throw" can't open IE through OLE" when I use fork to connect them.

Any thoughts?





I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction


In reply to fork cant support Win32::OLE ? by xiaoyafeng

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.