Trying to run your cucumber tests and interact with links,buttons in a page you have the following error page:
Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotVisibleError)
Try to use the :visible => true in your matchers, finders like:
find('#id_name',:visible => true).click
You have a location search in your application that uses google maps auto suggest, and you want to be able to select the first item, so that it can be used in your cucumber tests.
You can create a step as in the code below, and put it in one of your cucumber step definitions:
When /^I do a map search$/ do
item = page.find(".pac-container .pac-item:first")
and then you can call this step from any other step in your cucumber tests by:
step "I do a map search"
You are using cucumber for your tests and you would like to use the modal dialog confirmation box in a rails application, with capybara but you are getting the following error:
Modal dialog present Selenium::WebDriver::Error::UnhandledAlertError)
In your steps file use the following to accept (press OK), in the confirmation dialog that pops up:
NOTE: Or in more recent versions when the above complains for ‘undefined method wait_until’
NOTE: Taken from the second comment made here
You are trying to use page.has_content? inside a cucumber step definition, but it doesn’t work as it matches all text, and returns always true.
Change the page.has_content? to page.should have_content instead and the tests should be failing when the text doesn’t match.