I have to write tests for a web site. I am trying to get the selected value of a dropdown box. So far i can get the contents of the dropdown by doing
find_f
There's a have_select matcher if you use Capybara with Rspec:
expect(page).to have_select('my-select', selected: 'Option 2')