Class: OperaWatir::QuickDropdown

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

Overview

QuickWidget

Direct Known Subclasses

QuickFind

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

#dropped_down?Boolean

Returns true if dropdown is dropped_down/open, else false.

Examples:

browser.quick_dropdown(:name, "Close_tab_dropdown").dropped_down?

Returns:

  • (Boolean)

    true if dropdown is dropped_down/open, else false



34
35
36
# File 'lib/operawatir/quickwidgets/quick_dropdown.rb', line 34

def dropped_down?
  element.getValue() > 0
end

#open_with_clickObject

Click dropdown to open it

Examples:

browser.quick_dropdown(:name, "Close_tab_dropdown").open_with_click


45
46
47
48
# File 'lib/operawatir/quickwidgets/quick_dropdown.rb', line 45

def open_with_click
  click
  sleep(0.1)
end

#selected?(string_id) ⇒ Boolean

Checks if the item selected in the dropdown matches the text loaded from Opera using the string_id

Parameters:

  • string_id (String)

    String ID to use to load the string from the current language file (e.g. “D_NEW_PREFERENCES_GENERAL”)

Returns:

  • (Boolean)

    true if the dropdown has the item with the string_id selected, otherwise false

Raises:



23
24
25
# File 'lib/operawatir/quickwidgets/quick_dropdown.rb', line 23

def selected?(string_id)
  element.isSelected(string_id)
end