class FireWatir::Form

Attributes

element_name[RW]

Public Class Methods

new(container, how, what) click to toggle source

Description:

Initializes the instance of form object.

Input:

- how - Attribute to identify the form element.
- what - Value of that attribute.
# File lib/firewatir/elements/form.rb, line 13
def initialize(container, how, what)
  @how = how
  @what = what
  @container = container
end

Public Instance Methods

locate() click to toggle source
# File lib/firewatir/elements/form.rb, line 19
def locate
  # Get form using xpath.

  case @how
  when :jssh_name
    @element_name = @what
  when :xpath
    @element_name = element_by_xpath(@container, @what)
  else
    @element_name = locate_tagged_element("form", @how, @what)
  end
  @o = self
end
submit() click to toggle source

Submit the form. Equivalent to pressing Enter or Return to submit a form.

# File lib/firewatir/elements/form.rb, line 33
def submit
  assert_exists
  submit_form
  @o.wait
end