Mar 4, 2010, 2:19 PM
Post #1 of 3
I am new in this forum, and I hope that someone can help me figure out the following.
I am using Perl and Win32::IE::Mechanize to automate some task in my job. Before I have used WWW::Mechanize, but because of Java-scripts I had to switch.
I can successfully connect to the site, read and submit data, however I have an issue when I want to set value for Select Option.
Mechanize just cannot find the select control, so alway trow back an error.
I have straggling with this since few days, and I do not found anything yet.
This is the HTML code with the select
<select ID="selectTest" onchange="DoSomething(0);">
<option value="">- Select Type -</option>
And this is the Perl code to set value.
my $mech = Win32::IE::Mechanize->new( visible => 1);
$mech->form_name( 'form1' );
$mech->select( 'selectTest', '2' );
If I run this, it will trow an error saying that Select 'selectTest' not found.
Can someone help me on this please?