Method: Celerity::SelectList#select_value
- Defined in:
- lib/celerity/elements/select_list.rb
#select_value(value) ⇒ String
Selects the option(s) whose value attribute matches the given string.
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/celerity/elements/select_list.rb', line 68 def select_value(value) assert_exists selected = @object.getOptions.map { |e| e.click if Util.matches?(e.getValueAttribute, value) }.compact.first unless selected raise NoValueFoundException, "unknown option with value #{value.inspect} for select_list #{@conditions.inspect}" end selected.asText end |