Question : Ruby\Watir Table Iteration

I am trying to iterate thru a table in a webpage.
This works:: table = ie.table(:index,5) <- it finds the correct table in the page
This works::xtable = ie.table(:index,5).row_count() <- it returns 23, the num of rows

THIS DOESN'T WORK::  ie.tables.each { |t| puts t.to_s }  

I want to pull the above table(:index,5) with xtable=23 rows into a new array\table\puts column by column and it just wont work for me.
I also tried this
t = ie.table(:index, 5)            # the table which contains another
   t.row.length => xtable
   t.row.each {|r| puts r}
   end
and recieved an error:: rb:59: syntax error, unexpected tASSOC, expecting $end



Answer : Ruby\Watir Table Iteration

Can you try this?
t = ie.table(:index, 5)
t.row.each {|r| puts r}

You can also put a breakpoint in your code and try things in irb, or just use irb and make objects and try them that way.
Random Solutions  
 
programming4us programming4us