Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `render' for #<Capybara::Selenium::Driver:0xbe790b8> #84

Closed
virvit opened this Issue Apr 9, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@virvit
Copy link

virvit commented Apr 9, 2014

Hello.

Is there a way to solve this?

My spec_helper.rb has this:
...
require 'capybara/rspec'
require 'capybara/rails'
...
require 'capybara-screenshot/rspec'
...
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end

Capybara.javascript_driver = :chrome
Capybara.default_driver = :chrome

Error occurs whenever test fails or I try to create screenshot manually.

An error occurred in an after hook
NoMethodError: undefined method render' for #<Capybara::Selenium::Driver:0xbe790b8> occurred at C:/VirVit/Ruby200/lib/ruby/gems/2.0.0/gems/capybara-screenshot-0.3.19/lib/capybara-screenshot.rb:73:inblock (2 levels) in <top (required)>'

gemfile.lock is:
capybara (2.2.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (> 2.0)
capybara-email (2.3.0)
capybara (
> 2.2.0)
mail
capybara-screenshot (0.3.19)
capybara (>= 1.0, < 3)
launchy

Thank you in advance! :)

@backspace

This comment has been minimized.

Copy link

backspace commented Apr 23, 2014

Capybara::Screenshot doesn’t know that :chrome is a Selenium driver. Either call your driver :selenium and it’ll use this code to take screenshots, or define a similar driver:

Capybara::Screenshot.register_driver(:chrome) do |driver, path|
  driver.browser.save_screenshot(path)
end

@virvit virvit closed this Apr 24, 2014

@rashichopra

This comment has been minimized.

Copy link

rashichopra commented Jun 19, 2014

Hi there, I am able to get the screenshots using above but its not appending the screenshot path to the rspec html report. What do I need to do for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.