我有一个 Rails 3.2 应用程序。我正在尝试设置黄瓜测试以使用 Google chrome 运行。我已经添加了相同的配置:
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
另外,我已经在 /usr/bin/ 中安装了 chromedriver 及其二进制文件:
➜ ~ ls -lah /usr/bin | grep chrome
-rwxrwxrwx 1 root root 18M May 20 15:42 chromedriver
lrwxrwxrwx 1 root root 32 Apr 6 10:19 google-chrome -> /opt/google/chrome/google-chrome
当我尝试运行一个仅打开 google.com 并搜索某些内容的简单功能时,我收到以下错误:
unexpected response, code=404, content-type=""
unknown command: session/url (Selenium::WebDriver::Error::WebDriverError)
./features/step_definitions/google_steps.rb:2:in `/^I am on the google page$/'
features/google.feature:3:in `Given I am on the google page'
其余的跟踪:
unexpected response, code=404, content-type=""
unknown command: session/url (Selenium::WebDriver::Error::WebDriverError)
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/common.rb:66:in `create_response'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/default.rb:66:in `request'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:619:in `raw_execute'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:597:in `execute'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:103:in `get'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/common/navigation.rb:14:in `to'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/capybara-2.1.0/lib/capybara/selenium/driver.rb:90:in `reset!'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/capybara-2.1.0/lib/capybara/session.rb:77:in `reset!'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/capybara-2.1.0/lib/capybara.rb:245:in `block in reset_sessions!'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/capybara-2.1.0/lib/capybara.rb:245:in `each'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/capybara-2.1.0/lib/capybara.rb:245:in `reset_sessions!'
/home/arkiver/.rvm/gems/ruby-1.9.3-p392@tests/gems/capybara-2.1.0/lib/capybara/cucumber.rb:10:in `After'
需要帮助弄清楚我在这里缺少什么。