我试图运行JavaScript代码的一些验收测试。然而,当我尝试使用水豚用硒,我一直得到以下几点:硒:: webdriver的::错误:: WebDriverError:
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:1234, CTRL+C to stop
FF>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:1234, CTRL+C to stop
F
Failures:
1) end to end acceptance test shows that x wins when it does
Failure/Error: @application.start
Selenium::WebDriver::Error::WebDriverError:
Unable to find the chromedriver executable. Please download the server from http://code.google.com/p/chromedriver/downloads/list and place it somewhere on your PATH. More info at http://code.google.com/p/selenium/wiki/ChromeDriver.>> Thin web server (v1.3.1 codename Triple Espresso)
# ./spec/acceptance/application_driver.rb:24:in `start'
# ./spec/acceptance/end_to_end.rb:6:in `block (2 levels) in <top (required)>'
下面的代码是什么应该启动驱动程序。我从http://code.google.com/p/chromedriver/downloads/list下载相应的文件,我把它放在我的道路通过运行PATH = $ PATH:/目录/何/ chromedriver /存在和导出路径,并使其可执行,但仍然得到了错误。有什么我失踪?
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
Capybara.default_driver = :chrome
class TicTacToeApplicationDriver
include Capybara::DSL
include Capybara::RSpecMatchers
APPLICATION_PORT = 1234
def initialize
@application_server = ApplicationServer.new
end
def start
@application_server.start
visit "http://localhost:#{APPLICATION_PORT}/index.html"
end
谢谢,你的回答帮我指出了正确的方向。这解决了这个问题: http://stackoverflow.com/a/10010381/1089462 – Ectac