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

Reply via email to