Method: WatirRobot::Page#page_should_contain_element

Defined in:
lib/watir_robot/keywords/page.rb

#page_should_contain_element(loc) ⇒ Object

Verify element exists on page

Parameters:

  • loc (String)

    attribute/value pairs that match an HTML element

Raises:



162
163
164
165
# File 'lib/watir_robot/keywords/page.rb', line 162

def page_should_contain_element(loc)
  raise(Exception::ElementDoesNotExist, "The element described by #{loc} is not contained within the page:\n#{@browser.html}") unless
    @browser.element(parse_location(loc)).exists?
end