Class: Watir::RadioCheckCommon

Inherits:
InputElement show all
Defined in:
lib/watir/input_elements.rb,
lib/watir/camel_case.rb

Overview

This class contains common methods to both radio buttons and check boxes. Normally a user would not need to create this object as it is returned by the Watir::Container#checkbox or by Watir::Container#radio methods – most of the methods available to this element are inherited from the Element class

Direct Known Subclasses

CheckBox, Radio

Constant Summary

Constants inherited from Element

Element::TO_S_SIZE

Instance Attribute Summary

Attributes inherited from Element

#container

Attributes included from Container

#activeObjectHighLightColor, #page_container, #type_keys, #typingspeed

Instance Method Summary collapse

Methods inherited from InputElement

#initialize, #locate

Methods inherited from Element

#<=>, #__ole_inner_elements, #activeObjectHighLightColor, #after_text, #assert_enabled, #assert_exists, #attribute_value, #before_text, #click, #click!, #create_event, #dispatch_event, #document, #enabled?, #exists?, #fire_event, #flash, #focus, inherited, #initialize, #locate, #method_missing, #name, #ole_object, #ole_object=, #parent, #text, #to_s, #type_keys, #typingspeed, #visible?

Methods included from Container

#__ole_inner_elements, #input_element_locator, #locator_for, #log, #set_container, #show_all_objects, #tagged_element_locator, #wait

Constructor Details

This class inherits a constructor from Watir::InputElement

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Watir::Element

Instance Method Details

#getStateObject



50
# File 'lib/watir/camel_case.rb', line 50

alias getState set?

#inspectObject



486
487
488
# File 'lib/watir/input_elements.rb', line 486

def inspect
  '#<%s:0x%x located=%s how=%s what=%s value=%s>' % [self.class, hash*2, !!ole_object, @how.inspect, @what.inspect, @value.inspect]
end

#isSet?Object



51
# File 'lib/watir/camel_case.rb', line 51

alias isSet?   set?

#set?Boolean Also known as: checked?

This method determines if a radio button or check box is set. Returns true if set/checked; false if not set/checked. Raises UnknownObjectException if its unable to locate an object.

Returns:

  • (Boolean)


493
494
495
496
# File 'lib/watir/input_elements.rb', line 493

def set? 
  assert_exists
  return @o.checked
end