当我使用标签@firebug运行我的特性时,我的测试运行并顺利通过,但是当我删除标签@firebug并运行测试headless时,我得到了错误timed out (Capybara::TimeoutError)。不幸的是,我不能提供更多的信息。我并不是真的希望得到一个答案,但如果能帮我指明正确的方向,我将不胜感激。
发布于 2012-12-03 15:52:59
尝试将@javascript放入,然后运行headless...hope it works...
您可以再尝试一种解决方案。我已经通过使用google Chrome而不是Firefox删除了这个错误,并使用了遏制协议。首先,您必须获得chrome驱动程序。如果不移除fakeweb (我认为这是罪魁祸首),我就不会得到这个错误
yum install curl
yum install curl-devel
gem install curb
cd /usr/bin/chromedriver
chmod +x /usr/bin/chromedriver将其包含在您env.rb中
require 'selenium/webdriver/remote/http/curb'
Capybara.register_driver :selenium do |app|
#http_client = Selenium::WebDriver::Remote::Http::Default.new
#http_client.timeout = 100
#Capybara::Selenium::Driver.new(app, :browser => :firefox, :http_client => http_client)
http_client = Selenium::WebDriver::Remote::Http::Curb.new
Capybara::Selenium::Driver.new(app, :browser => :chrome, :http_client => http_client)
end 希望这能帮上忙。
https://stackoverflow.com/questions/12899114
复制相似问题