Class: Watir::CheckboxGroup
- Defined in:
- lib/watirloo/extension/watir_ducktape.rb
Overview
Checkbox group semantically behaves like multi select list box. each checkbox is a menu item groupped by the common attribute :name each checkbox can be off initially (a bit different semantics than RadioGroup)
Instance Method Summary collapse
-
#initialize(container, how, what) ⇒ CheckboxGroup
constructor
A new instance of CheckboxGroup.
- #name ⇒ Object
-
#selected_values ⇒ Object
returns array of value attributes.
Methods included from CheckboxGroupCommonWatir
#selected_checkboxes, #selected_value, #set?
Methods included from RadioCheckGroup
Methods included from RadioCheckGroupCommonWatir
#[], #get_by_position, #get_by_value, #set, #size, #values
Constructor Details
#initialize(container, how, what) ⇒ CheckboxGroup
Returns a new instance of CheckboxGroup.
276 277 278 279 280 281 |
# File 'lib/watirloo/extension/watir_ducktape.rb', line 276 def initialize(container, how, what) @container = container @how = how @what = what @o = locate end |
Instance Method Details
#name ⇒ Object
283 284 285 |
# File 'lib/watirloo/extension/watir_ducktape.rb', line 283 def name @name end |
#selected_values ⇒ Object
returns array of value attributes. Each Checkbox in a group has a value which is invisible to the user
303 304 305 306 307 308 309 |
# File 'lib/watirloo/extension/watir_ducktape.rb', line 303 def selected_values values = [] selected_checkboxes.each do |cb| values << cb.ole_object.invoke('value') end return values end |