Sha256: 177e15acae1cd2ce09de07f6c26d497e622ebf894df0980cb67c327cfb781434

Contents?: true

Size: 914 Bytes

Versions: 26

Compression:

Stored size: 914 Bytes

Contents

module FireWatir
  class Form < Element

    attr_accessor :element_name
    #
    # Description:
    #   Initializes the instance of form object.
    #
    # Input:
    #   - how - Attribute to identify the form element.
    #   - what - Value of that attribute.
    #
    def initialize(container, how, what)
      @how = how
      @what = what
      @container = container
    end

    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 the form. Equivalent to pressing Enter or Return to submit a form.
    def submit
      assert_exists
      submit_form
      @o.wait
    end

  end # Form
end # FireWatir

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
firewatir-1.9.4 lib/firewatir/elements/form.rb
firewatir-1.9.3 lib/firewatir/elements/form.rb
firewatir-1.9.2 lib/firewatir/elements/form.rb
firewatir-1.9.2.rc1 lib/firewatir/elements/form.rb
firewatir-1.9.1 lib/firewatir/elements/form.rb
firewatir-1.9.1.rc1 lib/firewatir/elements/form.rb
firewatir-1.9.0 lib/firewatir/elements/form.rb
firewatir-1.9.0.rc7 lib/firewatir/elements/form.rb
firewatir-1.9.0.rc6 lib/firewatir/elements/form.rb
firewatir-1.9.0.rc5 lib/firewatir/elements/form.rb
firewatir-1.9.0.rc4 lib/firewatir/elements/form.rb
firewatir-1.9.0.rc3 lib/firewatir/elements/form.rb
firewatir-1.9.0.rc2 lib/firewatir/elements/form.rb
firewatir-1.9.0.rc1 lib/firewatir/elements/form.rb
firewatir-1.8.1 lib/firewatir/elements/form.rb
firewatir-1.8.1.rc1 lib/firewatir/elements/form.rb
firewatir-1.8.0 lib/firewatir/elements/form.rb
firewatir-1.8.0.rc1 lib/firewatir/elements/form.rb
firewatir-1.7.1 lib/firewatir/elements/form.rb
firewatir-1.7.0 lib/firewatir/elements/form.rb