Search code examples
rubycucumberpage-object-gem

nested table iteration error when using page-object gem


I'm trying to use PageObject gem and stuck on table iteration. Here what I have:

HTML

<table id='list'>
  <tbody>
    <tr class='somename'>
      <td><a id='someid'><u>Edit</u></a></td>
    </tr>
    <tr class='somename'>
      <td><a id='someid'><u>Edit</u></a></td>
    </tr>
  </tbody>
</table>

PAGE_CLASS

table(:my_table, id: 'list')

STEP

@current_page.my_table_element.each do |row|
  puts row.link_element(text: 'Edit')
end

ERROR

Watir::Exception::UnknownObjectException: timed out after 30 seconds, waiting for {:id=>"list", :tag_name=>"table"} --> {:index=>0, :tag_name=>"tr"} --> {:text=>"Edit", :tag_name=>"a"} to be located

I see it is not passing tbody tag. Any idea how to make it work?


Solution

  • Wait time solved this issue for me.