Sha256: 4352afbdb62e0c140db96749b428956c74d41384b2e41110a8596667b21c473e

Contents?: true

Size: 1.43 KB

Versions: 8

Compression:

Stored size: 1.43 KB

Contents

module OperaWatir
  class QuickAddressField < QuickEditField

    # Checks the type of the widget is correct
    #
    # @private
    def correct_type?
      @element.getType == WIDGET_ENUM_MAP[:addressfield]
    end

    # Enters the url into the address field, and waits for page loading 
    # to finish
    #
    # @param  [String] URL to load
    # @return [String] text in the address field after the page is loaded
    #                  or a blank string
    # @raise [Exceptions::UnknownObjectException] if the widget could not be found
    #           using the specified method
    def load_page_with_url(url)
      # Must focus field before calling enter_text...
      focus_with_click
      # Enters text in a field and then hits enter
      enter_text_and_hit_enter(url)
    end
    
    #
    # Gets the visible text in the address field
    #
    # @return [String] visible text in address field
    #
    # @raise [Exceptions::UnknownObjectException] if the widget could not be found
    #           using the specified method
    def visible_text
      element.getVisibleText()
    end
    
    #
    # Gets the highlighted text in the address field
    #
    # @return [String] higlighted text in address field, if any, else empty
    #
    # @raise [Exceptions::UnknownObjectException] if the widget could not be found
    #           using the specified method
    def highlighted_text
      element.getAdditionalText()     
    end
    
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
operawatir-0.4.3.pre1-jruby lib/operawatir/quickwidgets/quick_addressfield.rb
operawatir-0.4.2-jruby lib/operawatir/quickwidgets/quick_addressfield.rb
operawatir-0.4.1-jruby lib/operawatir/quickwidgets/quick_addressfield.rb
operawatir-0.4.1.pre7-jruby lib/operawatir/quickwidgets/quick_addressfield.rb
operawatir-0.4.1.pre6-jruby lib/operawatir/quickwidgets/quick_addressfield.rb
operawatir-0.4.1.pre5-jruby lib/operawatir/quickwidgets/quick_addressfield.rb
operawatir-0.4.1.pre4-jruby lib/operawatir/quickwidgets/quick_addressfield.rb
operawatir-0.4.1.pre3-jruby lib/operawatir/quickwidgets/quick_addressfield.rb