Thread

Posted on Thu Feb 1 22:33:28 2007 by perlweb07
Not able to select a check box which does not have a name attribute
Hi, I am trying to check a check box so that I can login to a web page. input id="checkbox" type="checkbox" This check box does not have a name. The tick method need a name to be passed. Any help would be greatly appreciated. Thanks Perl Web
Direct Responses: 4226 | Write a response
Posted on Fri Feb 2 15:05:06 2007 by abeltje in response to 4223
Re: Not able to select a check box which does not have a name attribute
Hi, One can try to find the checkbox from the form (UNTESTED): my $form = $ie->form_number( 1 ); my @cbs = $form->find_input( undef, 'checkbox' ); for my $cb ( @cbs ) { ${$cb}->{id} or next; ${$cb}->{id} eq 'checkbox' and ${$cb}->{checked} = 1; } HTH, -- Abe.
Direct Responses: 4228 | Write a response
Posted on Fri Feb 2 19:02:56 2007 by perlweb07 in response to 4226
Re: Not able to select a check box which does not have a name attribute
Thanks for the above code. This code workd. But I still have some issues. This check box need to be passed both CHECKED and a value in value='Yes' otherwise the Login button will not be enabled. Any help !!! PerlWeb07
Direct Responses: 4236 | Write a response
Posted on Sat Feb 3 13:27:53 2007 by abeltje in response to 4228
Re: Not able to select a check box which does not have a name attribute
Hi, does this checkbox have an onclick javascript-handler attached to it? if so, you might want to call the click() method on it: ${$cb}->{id} eq 'checkbox' and ${$cb}->click; else you must set the value explicitly: ${$cb}->{id} eq 'checkbox' and ${$cb}->{value} = 'Yes', ${$cb}->{checked} = 1; HTH, -- Abe.
Direct Responses: 4252 | Write a response
Posted on Mon Feb 5 23:58:45 2007 by perlweb07 in response to 4236
Re: Not able to select a check box which does not have a name attribute
Thanks for the response. I was able to set the value and login. Sorry for asking so many questions but now I have another problem. I need to upload a file. The control on the fomr is Type=file. I was able to access this by use the click method of this control. Here is the problem, after I click on this Browse button a "Choose file" dialog box appears. I want to put the file name in the "File name :" text box and click "Open" button. I am not able to access this dialog box. Any hlep would be great. Thanks, PerlWeb
Direct Responses: 4268 | 4310 | Write a response
Posted on Wed Feb 7 01:17:06 2007 by abeltje in response to 4252
Re: Not able to select a check box which does not have a name attribute
Hi, File Upload is known not to work bij just setting the value of input control. I have never tried to + use the gui-way by "pressing" the 'Browse' button. This is where you might need to use the Win32::GuiTest module. But I have never used it. HTH, -- Abe.
Write a response
Posted on Sat Feb 10 13:34:26 2007 by abeltje in response to 4252
Re: Not able to select a check box which does not have a name attribute
Hi, File Upload is known not to work bij just setting the value of input control. I have never tried to + use the gui-way by "pressing" the 'Browse' button. This is where you might need to use the Win32::GuiTest module. But I have never used it. HTH, -- Abe.
Write a response