Hello,<br>
I have a problem with this table:<br>
[code]
    <table id="tblleftNav" height="100%" width="100%">
                <tr>
                        <td id="id1">
                                <img src="Blank.gif" alt="" border="0" />
                        </td>
                </tr>
                <tr height="0">
                        <td vAlign="top">
                                <table Width="100%" border="0">
                    <tr>
                        <td>Item 1</td>
                        <td><img src="uparrows_white.gif" /></td>
                    </tr>
                    <tr>
                        <td>
                            <table id="tblDetails">
                                <tr>
                                    <td> Sub Item 1</td>
                                    <td>Sub Value 1</td>
                                </tr>
                                <tr>
                                    <td> Sub Item 2</td>
                                    <td>Sub Value 2</td>
                                </tr>
                                <tr>
                                    <td> Sub Item 3</td>
                                    <td>Sub Value 3</td>
                                </tr>
                                <tr>
                                    <td> Sub Item 4</td>
                                    <td>Sub Value 4</td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>Item 2</td>
                        <td><img src="downarrows_white.gif" /></td>
                    </tr>
                    <tr>
                        <td>Item 3</td>
                    </tr>
                    <tr>
                        <td>Item 4</td>
                    </tr>
                    <tr>
                        <td>Item 5</td>
                    </tr>
                    <tr>
                        <td>Item 6</td>
                    </tr>
                </table>
                        </td>
                </tr>
                <tr height="100%" width="100%"  bgcolor="#ffffff">
                        <td>
                                <img src="bar.gif" />
                        </td>
                </tr>
                <tr height="0" bgcolor="#ffffff">
                        <td>
                                <img "logo.gif" />
                        </td>
                </tr>
        </table>
[/code]
When I try to read rows or columns data Watir failed with error:<br>

irb(main):005:0> tbl=Table.new(ie, :id, 'tblleftNav')<br>
irb(main):006:0> tbl.row_count<br>
=> 15<br>
irb(main):007:0> tbl.row_values(1)<br>
=> [""]<br>
irb(main):009:0> tbl.row_values(2)<br>
=> ["Item 1\r\n Sub Item 1Sub Value 1\r\n Sub Item 2Sub Value 2\r\n Sub Item 
3Sub Value 3\r\n Sub Item 4Sub Value 4\r\n\r\nItem 2\r\nItem 3\r\nItem 
4\r\nItem 5\r\nItem 6"]<br>
irb(main):008:0> tbl.row_values(5)<br>
WIN32OLERuntimeError: Unknown property or method `4'<br>
    HRESULT error code:0x80020006<br>
      Unknown name.<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3348:in 
`[]'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3348:in 
`row'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3310:in 
`column_count'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3366:in 
`row_values'<br>
        from (irb):8<br>
irb(main):013:0> tbl.column_values(1)<br>
WIN32OLERuntimeError: Unknown property or method `4'<br>
    HRESULT error code:0x80020006<br>
      Unknown name.<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3348:in 
`[]'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3348:in 
`row'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3294:in 
`[]'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3359:in 
`column_values'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3359:in 
`collect'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3359:in 
`each'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3359:in 
`collect'<br>
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:3359:in 
`column_values'<br>
        from (irb):13<br>
<br>
So, questions. <br>
1. How can I read all rows(columns) data separately (via .each)?<br>
2. How can I read rows of 1st level (Item 1, Item 2...) only?<br>
3. How can I read rows of 2st level (Sub Item 1, Sub Item 2...) only? But not 
use :id of second table, only first :id.<br>
4. Why Watir doesn't raise exception and failed?<br>
<br>
Can anybody help me?<br>
Thanks.<br>
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6565&messageID=18713#18713
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to