Method: Webrat::SeleniumSession#select

Defined in:
lib/webrat/selenium/selenium_session.rb

#select(option_text, options = {}) ⇒ Object



88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/webrat/selenium/selenium_session.rb', line 88

def select(option_text, options = {})
  id_or_name_or_label = options[:from]

  if id_or_name_or_label
    select_locator = "webrat=#{id_or_name_or_label}"
  else
    select_locator = "webratselectwithoption=#{option_text}"
  end

  selenium.wait_for_element select_locator, :timeout_in_seconds => 5
  selenium.select(select_locator, option_text)
end