gpt4 book ai didi

capybara - 无法执行save_screenshot在Capybara/Poltergeist中提供NotSupportedByDriver

转载 作者:行者123 更新时间:2023-12-04 05:31:00 25 4
gpt4 key购买 nike

我正在与Poltergeist一起运行Capybara,我有一个步骤:

Given(/^take a screenshot$/) do
page.save_screenshot("/tmp/page.png", :full => true)
end

它一直在说:
Capybara::Driver::Base#save_screenshot (Capybara::NotSupportedByDriverError)
./features/step_definitions/job_steps.rb:19:in `/^take a screenshot$/'
features/jobs_board/user_management.feature:9:in `And take a screenshot'

有什么想法在哪里看?我在env.rb中的配置看起来像这样:
Capybara.javascript_driver = :poltergeist
Capybara.current_driver = :poltergeist

最佳答案

弄清楚了。我需要添加:

Capybara.default_driver = :poltergeist 

并改变
require 'poltergeist'


require 'capybara/poltergeist'

关于capybara - 无法执行save_screenshot在Capybara/Poltergeist中提供NotSupportedByDriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21237803/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com