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: 
<br><br>module Watir<br><br>&nbsp; class H2&nbsp;&nbsp; &lt; NonControlElement<br>&nbsp;&nbsp;&nbsp; TAG = &#39;H2&#39;<br>&nbsp; end<br><br>&nbsp; class H2s&nbsp; &lt; ElementCollections<br>&nbsp;&nbsp;&nbsp; include Watir::CommonCollection<br>&nbsp;&nbsp;&nbsp; def element_class; H2; end<br>&nbsp; end
<br><br>&nbsp;module Container<br><br>&nbsp;&nbsp;&nbsp; def h2(how, what)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return H2.new(self, how, what)<br>&nbsp;&nbsp;&nbsp; end<br><br>&nbsp;&nbsp;&nbsp; def h2s<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return H2s.new(self)<br>&nbsp;&nbsp;&nbsp; end<br>end<br>end<br><br>ie.h2s.show<br><br>-Charley<br>
<br><br><div><span class="gmail_quote">On 4/5/07, <b class="gmail_sendername">aidy lewis</b> &lt;<a href="mailto:aidy.lewis@googlemail.com">aidy.lewis@googlemail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Are we all using the DOM method .getElementsByTagName to get for example,<br>a level 2 heading?<br><br>return document.getElementsByTagName(&#39;h2&#39;)<br><br>Should we refactor these methods to make a more abstract method
<br><br>show_labels<br>show_spans<br>show_pres<br>etc?<br><br>Thanks<br><br>aidy<br>_______________________________________________<br>Wtr-general mailing list<br><a href="mailto:Wtr-general@rubyforge.org">Wtr-general@rubyforge.org
</a><br><a href="http://rubyforge.org/mailman/listinfo/wtr-general">http://rubyforge.org/mailman/listinfo/wtr-general</a><br></blockquote></div><br>