Get select value of dropdown for capybara testing

There’s a have_select matcher if you use Capybara with Rspec:

expect(page).to have_select(
  'my-select',         # locator
  selected: 'Option 2' # option
) 
Parameters:

Locator (String) (defaults to: nil) — The label, name or id of a select box
Options (Hash) using :selected (String, Array) — Options which should be selected

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)