Class: Watir::CheckboxGroup

Inherits:
Object show all
Includes:
CheckboxGroupCommonWatir, RadioCheckGroup, RadioCheckGroupCommonWatir
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

Methods included from CheckboxGroupCommonWatir

#selected_checkboxes, #selected_value, #set?

Methods included from RadioCheckGroup

#get_by_value, #values

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

#nameObject



283
284
285
# File 'lib/watirloo/extension/watir_ducktape.rb', line 283

def name
  @name
end

#selected_valuesObject

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