The exception is saying that there is no method `table` for
`@adl_name_search`. Are you sure you are calling the `table` method for the
right object? It should be called for a Watir::Browser or a Watir::Element.
Once you do get the table element, you can iterate through each td element
by retrieving a tds collection:
browser.table(:id, 'tableSearchResult').tds.each do |td|
td.text == @lastname
end
However, since it looks like you want to compare the last name, perhaps you
want to find the row where the last name matches:
row = browser.table(:id, 'tableSearchResult').trs.find { |tr| tr.td(index:
0).text == @lastname }
- Justin
On Thursday, July 30, 2015 at 7:42:55 AM UTC-4, VIDYA SAGAR POGIRI wrote:
>
> Hi i want to iterate the values in a table in watir-web driver, when i use
> : @adl_name_search.table(:id, 'tableSearchResult')[i][i].text == @lastname
> , its giving error as :NoMethodError: undefined method `table' for
> #<ADL_namesearchmodpobj:0x31af118> , so kindly help me how to iterate the
> loop in a table.I have also attached the screen shot. Thanks in advance
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.