[Wtr-general] Help with workarround
Bret Pettichord
bret at pettichord.com
Mon Apr 24 17:34:27 EDT 2006
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
#{@how} and #{@what} " if @o == nil
return @o.rows.length
end
end
end
On 4/21/06, Michael Moore <stuporglue at gmail.com> 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
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060424/aa611770/attachment.html
More information about the Wtr-general
mailing list