How can get the text in a cell at position (row_no , col_no)
of a table in Capybara?
In Watir
it was easy to fetch a table element and do table_element[2][3]
.
How can this be done in Capybara?
How can get the text in a cell at position (row_no , col_no)
of a table in Capybara?
In Watir
it was easy to fetch a table element and do table_element[2][3]
.
How can this be done in Capybara?
Capybara also supports XPath for querying:
page.has_selector?(:xpath, '//table/tr[2]/td[3]')
There is this nice cheat sheet in case you want deepen your knowledge on how to traverse documents with XPath.
HTH.