Method: Selenium::WebDriver::Support::Select#first_selected_option
- Defined in:
- lib/selenium/webdriver/support/select.rb
#first_selected_option ⇒ Element
Get the first selected option in this select element
74 75 76 77 78 79 |
# File 'lib/selenium/webdriver/support/select.rb', line 74 def first_selected_option option = .find(&:selected?) return option if option raise Error::NoSuchElementError, 'no options are selected' end |