Class: OperaWatir::QuickCheckbox

Inherits:
QuickWidget show all
Defined in:
lib/operawatir/quickwidgets/quick_checkbox.rb

Direct Known Subclasses

QuickRadioButton

Constant Summary

Constants inherited from QuickWidget

OperaWatir::QuickWidget::ConditionTimeout

Instance Method Summary collapse

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

#checked?Boolean

Checks if the checkbox is checked

Returns:

  • (Boolean)

    true if the checkbox is checked otherwise false

Raises:



17
18
19
# File 'lib/operawatir/quickwidgets/quick_checkbox.rb', line 17

def checked?
  element.isSelected
end

#open_dialog_with_click(win_name) ⇒ int

Clicks the checkbox, and waits for the window with window name win_name to be shown

Parameters:

  • win_name (String)

    name of the window that will be opened (Pass a blank string for any window)

Returns:

  • (int)

    Window ID of the window shown or 0 if no window is shown

Raises:



52
53
54
55
56
# File 'lib/operawatir/quickwidgets/quick_checkbox.rb', line 52

def open_dialog_with_click(win_name)
  wait_start
  click
  wait_for_window_shown(win_name)
end

#toggle_with_clickBoolean

Clicks a radio button or checkbox and toggles it state

Returns:

  • (Boolean)

    the new state of the radio button or checkbox, false for not checked, or true for checked

Raises:



30
31
32
33
34
35
36
37
38
# File 'lib/operawatir/quickwidgets/quick_checkbox.rb', line 30

def toggle_with_click
  click

  # Cheat since we don't have an even yet
  sleep(0.1)

  # is this guaranteed to be same as getValue?
  element(true).isSelected
end