Class: Watir::Radio

Inherits:
Input show all
Defined in:
lib/watir-webdriver/elements/radio.rb

Constant Summary

Constants inherited from BaseElement

BaseElement::IGNORED_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from Input

#enabled?, #to_button, #to_checkbox, #to_radio, #to_select_list, #type

Methods inherited from BaseElement

attribute_list, #attribute_value, attributes, #click, #double_click, #driver, #element, #exists?, #fire_event, #flash, #focus, #html, #initialize, #inspect, #parent, #right_click, #run_checkers, #send_keys, #style, #tag_name, #text, typed_attributes, #value, #visible?

Methods included from Container

add

Methods included from XpathSupport

#element_by_xpath, #elements_by_xpath

Constructor Details

This class inherits a constructor from Watir::BaseElement

Instance Method Details

#setObject

Select this radio button.



13
14
15
16
17
18
# File 'lib/watir-webdriver/elements/radio.rb', line 13

def set
  assert_exists
  assert_enabled

  @element.click unless set?
end

#set?Boolean

Is this radio set?

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/watir-webdriver/elements/radio.rb', line 24

def set?
  assert_exists
  @element.selected?
end