Method: PageObject::Accessors#form

Defined in:
lib/page-object/accessors.rb

#form(name, identifier = {:index => 0}, &block) ⇒ Object

adds two methods - one to retrieve the form element, and another to check the form’s existence.

Examples:

form(:login, :id => 'login')
# will generate 'login_element' and 'login?' methods

Parameters:

  • the (Symbol)

    name used for the generated methods

  • identifier (Hash) (defaults to: {:index => 0})

    how we find a form. You can use a multiple parameters by combining of any of the following except xpath. The valid keys are:

    • :action => Watir and Selenium

    • :class => Watir and Selenium

    • :css => Selenium only

    • :id => Watir and Selenium

    • :index => Watir and Selenium

    • :xpath => Watir and Selenium

  • optional

    block to be invoked when element method is called



715
716
717
# File 'lib/page-object/accessors.rb', line 715

def form(name, identifier={:index => 0}, &block)
  standard_methods(name, identifier, 'form_for', &block)
end