Hi,
I am trying to delete a load of entries from a table, but am having
problems with iterating through the table.
Basically, I need to delete all entries that have "TM1" included in
the row. The following will run through once and delete one entry, but
then throws the error shown.
Also included a relevant snippet of the html

Any pointers appceciated

table = $browser.table(:index,0)

table.each do |row|
        if row.text.include?("TM1")
                row[0].link(:href, /show/).click
                $browser.button(:name, "_action_delete").click_no_wait
                $e.windowOK
                sleep 5
        end
end

This is the error I get:

  1) Error:
test01_DeleteETVP(ETVS_DeleteETVP):
WIN32OLERuntimeError: unknown property or method `rows'
    HRESULT error code:0x80070005
      Access is denied.
    C:/Ruby/lib/ruby/gems/1.8/gems/watir-2.0.1/lib/watir/table.rb:
144:in `invoke'
    C:/Ruby/lib/ruby/gems/1.8/gems/watir-2.0.1/lib/watir/table.rb:
144:in `_row'
    C:/Ruby/lib/ruby/gems/1.8/gems/watir-2.0.1/lib/watir/table.rb:
81:in `each'
    C:/Ruby/lib/ruby/gems/1.8/gems/watir-2.0.1/lib/watir/table.rb:
80:in `upto'
    C:/Ruby/lib/ruby/gems/1.8/gems/watir-2.0.1/lib/watir/table.rb:
80:in `each'
    C:/WATIR/CanoeCCMS/Util_Delete_ETVP_new.rb:18:in
`test01_DeleteETVP'



<tr class="even">
    <td><a href="/etvsm-test-harness/etvp/show/1103">1,103</a></td>
    <td>200</td>
    <td>True</td>
    <td>AETN</td>
    <td>True</td>
    <td>10</td>
</tr>

<tr class="odd">
    <td><a href="/etvsm-test-harness/etvp/show/1114">1,114</a></td>
    <td>5</td>
    <td>True</td>
    <td>TM10010</td>
    <td>True</td>
    <td>1</td>
</tr>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to