Search code examples
validationwatir

watir, how can I validate table presence


I am using watir in RadRails IDE. I need to validate if a table is present on the page. How can I do this? I can't check if some text in the table is present because I could have the same text in another table.


Solution

  • You "just" have to have a way to uniquely identify the table. I will assume that the table has id attribute.

    browser.table(:id => "one").present?
    # => returns true or false