10 Feb 2013, 06:07
Generic-user-small

Michael Allan (2 posts)

I’ve added the save_and_open_page as an After hook as per page 151, but the browser opens the saved page incorrectly. Rather than opening, eg.

file:///Users/michaelallan/scratch/cucumber-book/atm/capybara-201302101633346148374723.html

… it opens this instead:

http://capybara-201302101633346148374723.html/

… which of course doesn’t exist.

I’m using rvm and bundler on Mac OS X 10.6.8, with Safari set as my default browser. I’m also using slightly different gem versions that those specified, ie. the ones current as of today per this Gemfile:

source :rubygems

gem 'sinatra', '1.3.4'

group :development do
  gem 'rspec', '2.0.1'
  gem 'cucumber', '1.2.1'
  gem 'capybara', '2.0.2'
  gem 'launchy', '2.2.0'
end

Apologies if this is a silly question, but I’ve not had any luck googling for an answer. Thanks for any suggestions, and I’m really enjoying the book :-)

21 Jun 2013, 12:43
Generic-user-small

Chris Parsons (1 post)

Try setting @save_and_open_page_path@:

Capybara.configure do |config|
  config.save_and_open_page_path = 'tmp/capybara'
end

Chris

27 Feb 2014, 19:51
Generic-user-small

Francisco Morales (1 post)

@Chris Persons

I had to add the code you suggested to get my page loading as well, where would the proper place to put this code be?

Thanks, Andre

  You must be logged in to comment