In Watir 1.5 there is support for adding elements fairly easily so that you shouldn't have to call getElementsByTagName directly. We haven't added headings yet, but most other common elements are supported and easily extended, you could put the following in a file and include it in your scripts:
module Watir class H2 < NonControlElement TAG = 'H2' end class H2s < ElementCollections include Watir::CommonCollection def element_class; H2; end end module Container def h2(how, what) return H2.new(self, how, what) end def h2s return H2s.new(self) end end end ie.h2s.show -Charley On 4/5/07, aidy lewis <[EMAIL PROTECTED]> wrote:
Are we all using the DOM method .getElementsByTagName to get for example, a level 2 heading? return document.getElementsByTagName('h2') Should we refactor these methods to make a more abstract method show_labels show_spans show_pres etc? Thanks aidy _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general