yes and no!
its technically  a different element. 

Probably more importantly if it were added to the buttons collection or we used 
it like ie.button(:index,2) then existing scripts may now not work, as the 
reset button may now be in the middle of the collection (or index number). eg:

if I currently have 
ie.button(:index,2).click
for this html

<input type=button name='foo'>
<input type='reset' name=reset>
<input type=button name = button2>

and we add the reset type to the buttons objects, then my script is broken, as 
index 2 is now not the button2 that it was originally

Of course, if you're using name or id instead of index its not an issue.



Paul





----- Original Message -----
From: Bret Pettichord <[EMAIL PROTECTED]>
Date: Monday, July 18, 2005 10:14 am
Subject: Re: [Wtr-general] ie.buttons

> Sounds like a bug to me.
> 
> At 09:21 AM 7/18/2005, Angrez Singh wrote:
> 
> >
> >Hi,
> >
> >I think this is because while getting the collections for button 
> class 
> >watir only considers the button that of type 'submit', 'button', 
> or 
> >'image'. The buttons of type 'reset' have been implemented as a 
> separate 
> >class in watir. If you look at the code for 'Button' class in 
> watir.rb 
> >file, you'll see that the object types it takes is only an array 
> with the 
> >values mentioned above. And the class 'Reset' takes into 
> consideration the 
> >'reset' value.
> >
> >Don't know why it has been done separately ? Any explanation ?
> >
> >Regards,
> >Angrez
> >
> >On Mon, 18 Jul 2005 Zeljko Filipin wrote :
> > >Watir can not see reset buttons.
> > >
> > >html:
> > >
> > ><html>
> > ><body>
> > ><input type="reset">
> > ></body>
> > ></html>
> > >
> > >irb:
> > >
> > >irb(main):001:0> require 'watir'
> > >irb(main):002:0> ie = Watir::IE.attach(:title, //)
> > >irb(main):003:0> ie.buttons.each { |b| puts b.to_s }
> > >=> 0
> > >
> > >It works fine if <input type="reset"> is replaced with <input 
> type="submit">> >or <input type="image">:
> > >
> > >irb(main):004:0> ie.buttons.each { |b| puts b.to_s }
> > >type:        submit
> > >id:
> > >name:
> > >value:        Submit Query
> > >disabled:    false
> > >=> 0
> > >
> > >Also, if buttons are defined with button tag:
> > >
> > >html:
> > >
> > ><html>
> > ><body>
> > ><button type="button">
> > ><button type="reset">
> > ><button type="submit">
> > ></body>
> > ></html>
> > >
> > >irb:
> > >
> > >irb(main):005:0> ie.buttons.each { |b| puts b.to_s }
> > >=> 0
> > >
> > >Is this a bug or am I missing something?
> > >
> > >Zeljko
> > >
> > >_______________________________________________
> > >Wtr-general mailing list
> > >[email protected]
> > >http://rubyforge.org/mailman/listinfo/wtr-general
> >
> >
> >_______________________________________________
> >Wtr-general mailing list
> >[email protected]
> >http://rubyforge.org/mailman/listinfo/wtr-general
> 
> _____________________
>  Bret Pettichord
>  www.pettichord.com
> 
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
> 

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to