Module: WatirRobot::Radio

Included in:
KeywordLibrary
Defined in:
lib/watir_robot/keywords/radio.rb

Overview

Functionality related to radio button form elements

Instance Method Summary collapse

Instance Method Details

#radio_button_should_be_selected(loc) ⇒ Object

Verify that radio button is selected



27
28
29
30
# File 'lib/watir_robot/keywords/radio.rb', line 27

def radio_button_should_be_selected(loc)
  raise(Exception::RadioSelectionError, "The radio button located at #{loc} is not selected.") unless
    @browser.radio(parse_location(loc)).set?
end

#radio_button_should_not_be_selected(loc) ⇒ Object

Verify that radio button is not selected



37
38
39
40
# File 'lib/watir_robot/keywords/radio.rb', line 37

def radio_button_should_not_be_selected(loc)
  raise(Exception::RadioSelectionError, "The radio button located at #{loc} is selected erroneously.") if
    @browser.radio(parse_location(loc)).set?
end

#select_radio_button(loc) ⇒ Object

Select a radio button



15
16
17
# File 'lib/watir_robot/keywords/radio.rb', line 15

def select_radio_button(loc)
  @browser.radio(parse_location(loc)).set
end