Method: Capybara::Node::Element#select_option

Defined in:
lib/capybara/node/element.rb

#select_option(wait: nil) ⇒ Capybara::Node::Element

Select this node if it is an option element inside a select tag.

If the driver dynamic pages (JS) and the element is currently non-interactable, this method will continuously retry the action until either the element becomes interactable or the maximum wait time expires.

Parameters:

  • wait (false, Numeric) (defaults to: nil)

    Maximum time to wait for the action to succeed. Defaults to default_max_wait_time.

Returns:



139
140
141
142
# File 'lib/capybara/node/element.rb', line 139

def select_option(wait: nil)
  synchronize(wait) { base.select_option }
  self
end