Class: Watir::Container::SelectList
Constant Summary
Constants inherited
from HtmlElement
HtmlElement::OPERATIONS
Instance Attribute Summary
Attributes inherited from HtmlElement
#how, #what
Instance Method Summary
collapse
#by_value, #enabled?
Methods included from Clickable
#click
Methods inherited from HtmlElement
#exists?, #name, #operate
Instance Method Details
#option(how, what) ⇒ Object
253
254
255
|
# File 'lib/safariwatir.rb', line 253
def option(how, what)
Option.new(@scripter, self, how, what)
end
|
#select(label) ⇒ Object
245
246
247
|
# File 'lib/safariwatir.rb', line 245
def select(label)
option(:text, label).select
end
|
#select_value(value) ⇒ Object
249
250
251
|
# File 'lib/safariwatir.rb', line 249
def select_value(value)
option(:value, value).select
end
|
#selected_value ⇒ Object
269
270
271
|
# File 'lib/safariwatir.rb', line 269
def selected_value
selected_values.first
end
|
#selected_values ⇒ Object
257
258
259
260
261
262
263
264
265
266
267
|
# File 'lib/safariwatir.rb', line 257
def selected_values
values = []
index = 1
loop do
option = option(:index, index)
break unless option.exists?
values << option if option.selected?
index += 1
end
values.map {|o| o.text } end
|
273
274
275
|
# File 'lib/safariwatir.rb', line 273
def speak
@scripter.speak_options_for(self)
end
|
277
|
# File 'lib/safariwatir.rb', line 277
def tag; "SELECT"; end
|