class FireWatir::RadioCheckCommon

Description:

Base class for checkbox and radio button elements.

Attributes

element_name[RW]

Public Class Methods

new(container, how, what, value = nil) click to toggle source

Description:

Initializes the instance of element object. Element can be checkbox or radio button.

Input:

- how - Attribute to identify the element.
- what - Value of that attribute.
- value - value of the element.
# File lib/firewatir/elements/radio_check_common.rb, line 17
def initialize(container, how, what, value = nil)
  @how = how
  @what = what
  @value = value
  @container = container
end

Public Instance Methods

checked?() click to toggle source
Alias for: set?
clear() click to toggle source

Description:

Unchecks the radio button or check box element.
Raises ObjectDisabledException exception if element is disabled.
# File lib/firewatir/elements/radio_check_common.rb, line 60
def clear
  assert_exists
  assert_enabled
  #highlight(:set)

  set_clear_item(false)
  #highlight(:clear)

end
getState() click to toggle source
Alias for: set?
isSet?() click to toggle source
Alias for: set?
locate() click to toggle source

Description:

Locate the element on the page. Element can be a checkbox or radio button.
# File lib/firewatir/elements/radio_check_common.rb, line 28
def locate
  case @how
  when :jssh_name
    @element_name = @what
  when :xpath
    @element_name = element_by_xpath(@container, @what)
  else
    @element_name = locate_tagged_element("input", @how, @what, @type, @value)
  end
  @o = self
end
set() click to toggle source

Description:

Checks the radio button or check box element.
Raises ObjectDisabledException exception if element is disabled.
# File lib/firewatir/elements/radio_check_common.rb, line 73
def set
  assert_exists
  assert_enabled
  #highlight(:set)

  set_clear_item(true)
  #highlight(:clear)

end
set?() click to toggle source

Description:

Checks if element i.e. radio button or check box is checked or not.

Output:

True if element is checked, false otherwise.
# File lib/firewatir/elements/radio_check_common.rb, line 47
def set?
  assert_exists
  return @o.checked
end
Also aliased as: getState, checked?, isSet?