I've used (a solution posted by you):
@browser.tbody(:index, 0).rows.each_with_index do |row, index|
row.cells.each do |cell|
if cell.text == "some_text"
puts @browser.tbody(:index, 0)[index]
break
end
end
end
It returns: #<Watir::TableRow:0x1214726>. I want to return the actual
row index/number. I can do with a count but didn't wanted that
approach.
What i am trying to accomplish is to click delete/update (which id on
url is generated dynamically) based on a cell which i can identify by
text, therefore deleting/updating the corresponding row.
Here is the UI =>
http://i52.tinypic.com/2yu12jd.png
And DOM: =>
http://i53.tinypic.com/2bwo5t.png
Any other approach would be welcome:
Maybe something like (didn't get this work): @
browser.td(:text =>
"text_name").td(:xpath => ""//a[@href=/delete/").click
On May 5, 11:35 am, Željko Filipin <
zeljko.fili...@wa-research.ch>
wrote:
> On Thu, May 5, 2011 at 10:31 AM, Dan Claudiu Pop <
danclaudiu...@gmail.com>