Someone posted this code and it worked really well for me.

#Get actual row count when enbedded tables exists
def get_row_count_minus_enbedded_rows(table)
    num_rows=0
    begin
      (1..table.row_count).each do |i|
        num_rows = i
        table[i]
     end
    rescue
  end
  return num_rows
end



On Oct 23, 10:08 pm, "Alan Baird" <[EMAIL PROTECTED]> wrote:
> Paul -
> This issue is WTR-26
> (http://jira.openqa.org/browse/WTR-26)<http://jira.openqa.org/browse/WTR-26>,
> it's been around for a while.  Your solution looks like the one that is in
> this ticket.
>
> Alan
>
> On Thu, Oct 23, 2008 at 9:10 PM, Paul Denize <[EMAIL PROTECTED]>wrote:
>
>
>
>
>
> > Overloading the following seems to get past the limitations.  Perhaps
> > someone with more DOM experience can comment if there are any dangers
>
> > One thin I did notice is that it picks up <TH> data cells just like
> > <TD> ones
>
> > class Table
> >    def row_count
> >        assert_exists
> >        return @o.rows().length
> >    end
>
> >    def to_a
> >      assert_exists
> >      y = []
> >      table_rows = @o.rows()
> >      for row in table_rows
> >        puts row.to_a.inspect
> >        x = []
> >        for td in row.cells()
> >          x << td.innerText.strip
> >        end
> >        y << x
> >      end
> >      return y
> >    end
>
> > end- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to