##
use strict;
use warnings;
use Win32::IEAutomation;
my $ie = Win32::IEAutomation->new(
visible => 1,
maximize => 1,
warnings => 1,
);
$ie->gotoURL('http://www.example.com');
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->
SetValue('C:\test\9780547076034NIMAS.opf');
$ie->WaitForDone();
$ie->closeIE();
####
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->SetValue('C:\test\9780547076034NIMAS.opf');
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->SetValue('C:/test/9780547076034NIMAS.opf');
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->SetValue('C:\\test\\9780547076034NIMAS.opf');
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->SetValue('C://test//9780547076034NIMAS.opf');
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->SetValue("C:\test\9780547076034NIMAS.opf");
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->SetValue("C:/test/9780547076034NIMAS.opf");
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->SetValue("C:\\test\\9780547076034NIMAS.opf");
$ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile')->SetValue("C://test//9780547076034NIMAS.opf");
####
####
File to upload:
####
use strict;
use Win32::IEAutomation;
use warnings;
my $ie = Win32::IEAutomation->new( visible => 1, maximize => 1);
$ie->gotoURL('C:\ex.html');
$ie->getTextBox("name:", "upfile")->SetValue("C:\\qctool.jar");
$ie->WaitforDone;
####
File to upload:
####
use strict;
use Win32::IEAutomation;
use warnings;
my $ie = Win32::IEAutomation->new( visible => 1, maximize => 1);
$ie->gotoURL('C:\ex.html');
$ie->getTextBox("name:", "upfile")->SetValue("C:\\qctool.jar");
$ie->WaitforDone;
####
use diagnostics;
if( my $textbox = $ie->getTextBox('name:', 'ctl00$ContentPlaceHolderContent$FileUpload_opfFile') )
{
#Okay, now see if we can set the value
if( $textbox->SetValue('C:\\test\\9780547076034NIMAS.opf') )
{
print "it should work\n";
}
else {
print "could not set the value\n";
}
}
else {
print "could not get the text box\n";
}