acserve,

I think this is the reason the header rows are not displayed when using the 
"to_a()" Watir method. This is the source of the "to_a()" method (`Watir.rb` : 
Line 2432, v1.4.1 ):

        def to_a
            raise UnknownTableException ,  "Unable to locate a table using 
[EMAIL PROTECTED] and [EMAIL PROTECTED] " if @o == nil
            y = []
            table_rows = @o.getElementsByTagName("TR")
            for row in table_rows
                x = []
                for td in row.getElementsbyTagName("TD")
                    x << td.innerText.strip
                end
                y << x
            end
            return y            
        end

I'm sure this message board won't format this aesthetically, but take a look at 
the statement, "  table_rows = @o.getElementsByTagName("TR")". It appears that 
this particular method only starts grabbing cells from rows [i]only[/i], hence 
the "TR". I believe this could be fixed by starting this logic with a check for 
a "TH" row. Then the subsequent "x << td.innerText.strip" only retrieves cell 
text values starting from the first row.

Hope this helps :)
Nathan Christie
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6193&messageID=17709#17709
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to