Class: OperaWatir::QuickSearchField

Inherits:
QuickEditField show all
Defined in:
lib/operawatir/quickwidgets/quick_searchfield.rb

Constant Summary

Constants inherited from QuickWidget

OperaWatir::QuickWidget::ConditionTimeout

Instance Method Summary collapse

Methods inherited from QuickEditField

#clear, #focus_with_click, #key_press, #type_text

Methods inherited from QuickWidget

#click_with_condition, #double_click_with_condition, #enabled?, #exist?, #focus_with_click, #focus_with_hover, #has_ui_string?, #height, #middle_click_with_condition, #name, #open_menu_with_rightclick, #open_window_with_hover, #parent_name, #position, #quick_tabs, #quick_widgets, #right_click_with_condition, #text, #to_s, #type, #value, #verify_includes_text, #verify_text, #visible?, #widget_info_string, #width

Methods included from DesktopContainer

#quick_addressfield, #quick_button, #quick_checkbox, #quick_dialogtab, #quick_dropdown, #quick_dropdownitem, #quick_editfield, #quick_find, #quick_griditem, #quick_gridlayout, #quick_label, #quick_menu, #quick_menuitem, #quick_radiobutton, #quick_searchfield, #quick_tab, #quick_thumbnail, #quick_toolbar, #quick_treeitem, #quick_treeview, #quick_window

Instance Method Details

#search_with_text(search_text) ⇒ String

Enters the search text into the search field, and waits for page loading to finish

Examples:

(RSpec)

browser.quick_searchfield(:name, "tbs_MainSearch").search_with_text("old cars").should include "http://www.google"

Parameters:

  • url (String)

    text to search with

Returns:

  • (String)

    text in the address field after the page is loaded or a blank string



22
23
24
25
26
27
28
29
30
31
# File 'lib/operawatir/quickwidgets/quick_searchfield.rb', line 22

def search_with_text(search_text)
  # Must focus field before calling enter_text...
  focus_with_click

  # Enters text in a field and then hits enter
  t = enter_text_and_hit_enter(search_text)

  # return text in addressfield (in same window as search field)
  driver.findWidgetByName(WIDGET_ENUM_MAP[:addressfield], @window_id, "tba_address_field", "Document Toolbar").getText
end