Read more

Select an unknown option with Capybara

Dominik Schöler
September 06, 2011Software engineer at makandra GmbH

When you don't know which options are available, but need to have an option selected, use this step.

When /^I select the second option from "([^"]*)"$/ do |id|
  second_option = find(:xpath, "//*[@id='#{id}']/option[2]").text
  select(second_option, :from => id)
end
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot
Posted by Dominik Schöler to makandra dev (2011-09-06 15:00)