Well, I ended up getting with the following (using cucumber and capybara).
- When /^I select "([^\"]*)" from the autocomplete$/ do |user|
- find('#user').node.send_keys(Selenium::WebDriver::Keys.const_get(:KEYS)[:down])
- locate("a:contains('#{user}')").click
- end
It only works if the one being selected is the first item in the list. After digging around in the autocomplete code, I now realize, I might be able to achieve the same thing by triggering the mouseenter on the needed item. Not sure what the best way to do that.
I guess I could keep hitting down and check to see if the selected one contains the term I'm looking to select. If not, hit down again.