Class: Watir::Container::Checkbox

Inherits:
InputElement show all
Defined in:
lib/safariwatir.rb

Direct Known Subclasses

Radio

Constant Summary

Constants inherited from HtmlElement

HtmlElement::OPERATIONS

Instance Attribute Summary

Attributes inherited from HtmlElement

#how, #what

Instance Method Summary collapse

Methods inherited from InputElement

#enabled?, #speak, #tag

Methods included from Clickable

#click

Methods inherited from HtmlElement

#exists?, #name, #operate, #speak, #tag

Instance Method Details

#by_valueObject



203
204
205
# File 'lib/safariwatir.rb', line 203

def by_value
  @value
end

#checked?Boolean

Contributed by Kyle Campos

Returns:

  • (Boolean)


208
209
210
# File 'lib/safariwatir.rb', line 208

def checked?
  @scripter.checkbox_is_checked?(self)
end

#set(check_it = true) ⇒ Object



212
213
214
215
216
# File 'lib/safariwatir.rb', line 212

def set(check_it = true)
  return if check_it && checked?
  return if !check_it && !checked?
  click
end