Class: Watir::Radio
- Inherits:
-
RadioCheckCommon
- Object
- Element
- InputElement
- RadioCheckCommon
- Watir::Radio
- Defined in:
- lib/watir/input_elements.rb
Overview
–
this class makes the docs better
++ This class is the watir representation of a radio button. Normally a user would not need to create this object as it is returned by the Watir::Container#radio method
Constant Summary collapse
- INPUT_TYPES =
["radio"]
Constants inherited from Element
Instance Attribute Summary
Attributes inherited from Element
Attributes included from Container
#activeObjectHighLightColor, #page_container, #type_keys, #typingspeed
Instance Method Summary collapse
-
#clear ⇒ Object
This method clears a radio button.
-
#set ⇒ Object
This method sets the radio list item.
Methods inherited from RadioCheckCommon
#getState, #inspect, #isSet?, #set?
Methods inherited from InputElement
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, #inspect, #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
#clear ⇒ Object
This method clears a radio button. One of them will almost always be set. Returns true if set or false if not set.
Raises UnknownObjectException if its unable to locate an object
ObjectDisabledException IF THE OBJECT IS DISABLED
512 513 514 515 516 517 518 519 |
# File 'lib/watir/input_elements.rb', line 512 def clear assert_exists assert_enabled highlight(:set) @o.checked = false highlight(:clear) highlight(:clear) end |
#set ⇒ Object
This method sets the radio list item.
Raises UnknownObjectException if it's unable to locate an object
ObjectDisabledException if the object is disabled
524 525 526 527 528 529 530 531 532 |
# File 'lib/watir/input_elements.rb', line 524 def set assert_exists assert_enabled highlight(:set) @o.scrollIntoView @o.checked = true click highlight(:clear) end |