On 5/17/06, Jonathan Ni <[EMAIL PROTECTED]> wrote: > > Hi all: > I got kind interesting problem with tables in side table. > I have a page like this. <snip> > When my script print currentFrame.tables[1].row_count . It give me > 5 rows > I have a loop go through every row to find content and return the > row that I want. > However, when the loop go to 4th row, where the error occure. <snip> > I guess it's looking at index 2 table and somehow OLE object get confused? > How can I handle this kind situation.
It's giving 5 rows because it counts the number of TRs between the top level <table> and </table>. When accessing the rows however, it acts correctly, and can only hit the 4 existing rows. See this thread for a fix: http://www.mail-archive.com/wtr-general%40rubyforge.org/msg03471.html You can also edit watir.rb. Mine looks like this now and works correctly as far as I can tell. C:\ruby\lib\ruby\gems\1.8\gems\watir-1.4.1\watir.rb line 2416 <snip> def row_count raise UnknownTableException , "Unable to locate a table using [EMAIL PROTECTED] and [EMAIL PROTECTED] " if @o == nil return @o.rows.length end Hope that helps, -- 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
