I'm not sure this fully fixes your problem, but here's how to apply the workaround...

You'd want to redefine the row_count method in the Table class. You could directly modify the Watir source as you suggest.

 Or you can just load this after "require watir":

module Watir
  class Table
    def row_count 
raise UnknownTableException , "Unable to locate a table using [EMAIL PROTECTED] and [EMAIL PROTECTED] " if @o == nil
return @o.rows.length
end
  end
end



On 4/21/06, Michael Moore <[EMAIL PROTECTED] > wrote:
A web page has several nested tables, which are generated from a
database. I want to print the contents of each of the rows of the
outermost table using t.row_values(i).

I'm trying this:

for i in 1..t.row_count()
    print i, ": ", t.row_values(i), "\n";
end

however t.row_count() is returning the total number of <tr> tags
inside the outermost table. In other words, it's identifying the right
outermost table, but it's considering child-table's rows as it's own.
I found this bug:
http://rubyforge.org/tracker/index.php?func=detail&aid=2177&group_id=104&atid=487
but don't understand how to implement his implementation. Do I edit
the ruby script that currently has row_count() in it, and replace it
with his implementation?

Thanks,
--
Michael Moore
-------------------------------
www.stuporglue.org -- Donate your used computer to a student that needs it.
www.ubuntu-utah.org -- In Utah? Interested in Ubuntu? Come join us.

_______________________________________________
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