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
In reply to fork cant support Win32::OLE ? by xiaoyafeng
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |