History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WTR-226
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Hugh
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Watir

WIN32OLERuntimeError with table.each() if there are embedded tables

Created: 01/Jul/08 06:20 PM   Updated: 01/Jul/08 06:20 PM
Component/s: HTML Controls
Affects Version/s: 1.5.6
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Watir 1.5.6 ( I also see it on 1.5.2), WinXP


 Description  « Hide
If there's a table embedded in table, you get a WIN32OLERuntime error when iterating over the outer table with each(). If you iterate on the inner table it works properly. I've included some sample html and an IRB session snippet

Outer Table

irb(main):010:0> ie.tables[1].each { |t| puts t.class}
Watir::TableRow
Watir::TableRow
WIN32OLERuntimeError: unknown property or method `2'
    HRESULT error code:0x80020006
      Unknown name.
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/table.rb:154:in
`[]'
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/table.rb:154:in
`_row'
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/table.rb:91:in `
each'
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/table.rb:90:in `
upto'
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/table.rb:90:in `
each'
        from (irb):10

Inner Table

irb(main):011:0> ie.tables[2].each { |t| puts t.class}
Watir::TableRow
=> 1

<html><title>Embedded Table Test</title><body>
<table border>
  <tr><td>Outer table</td></tr>
  <tr><td><table border><tr><td>Inner Table</td></tr></table></td></tr>
</table>
</body></html>

 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.