xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:
I wrote a snippet in perl for Web automation:
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.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 }
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fork cant support Win32::OLE ?
by Corion (Patriarch) on Feb 10, 2010 at 16:38 UTC | |
by ikegami (Patriarch) on Feb 10, 2010 at 17:23 UTC | |
by xiaoyafeng (Deacon) on Feb 10, 2010 at 17:07 UTC | |
by xiaoyafeng (Deacon) on Feb 10, 2010 at 17:25 UTC | |
by Corion (Patriarch) on Feb 10, 2010 at 17:29 UTC | |
by ikegami (Patriarch) on Feb 10, 2010 at 17:33 UTC |