title: how to select the first element from a dropdown. RoR/Capybara/Selenium
body: <p>So this code was working perfectly fine, until I recently updated my selenium webdriver:</p>
  
  <pre><code>When /^I search for (.*)$/ do |term|
      term = " " if term == "blank"
      step "I fill in search with #{term}"
      within(".navbar-search") do
          page.find(:css, "li:first").click
      end
  end
  </code></pre>
  
  <p>I updated, and now I get the following error:</p>
  
  <pre><code> An invalid or illegal string was specified (Selenium::WebDriver::Error::UnknownError)
    ./features/step_definitions/search_steps.rb:5:in `block (2 levels) in &lt;top (required)&gt;'
    ./features/step_definitions/search_steps.rb:4:in `/^I search for (.*)$/'
    features/search_friend.feature:13:in `When I search for &lt;term&gt;'
  </code></pre>
  
  <p>Here is the cucumber feature:</p>
  
  <pre><code>@javascript
  Scenario Outline: The search bar
      Given I login
      And I have a contact named ABC
      And I have a contact named DEF
      And I have a contact named GHI
      When I search for &lt;term&gt;
      Then I should see the message &lt;message&gt;
  
      Examples:
      | term | message |
      | ... some examples ... | |
  </code></pre>