2013-05-20 102 views
0

我有一個Rails 3.2應用程序。我正在嘗試設置使用Google chrome運行的黃瓜測試。此外Selenium WebDriverError on rails 3.2 with yellow

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/[email protected]/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/common.rb:66:in `create_response' 
     /home/arkiver/.rvm/gems/[email protected]/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/default.rb:66:in `request' 
     /home/arkiver/.rvm/gems/[email protected]/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/common.rb:40:in `call' 
     /home/arkiver/.rvm/gems/[email protected]/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:619:in `raw_execute' 
     /home/arkiver/.rvm/gems/[email protected]/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:597:in `execute' 
     /home/arkiver/.rvm/gems/[email protected]/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:103:in `get' 
     /home/arkiver/.rvm/gems/[email protected]/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/common/navigation.rb:14:in `to' 
     /home/arkiver/.rvm/gems/[email protected]/gems/capybara-2.1.0/lib/capybara/selenium/driver.rb:90:in `reset!' 
     /home/arkiver/.rvm/gems/[email protected]/gems/capybara-2.1.0/lib/capybara/session.rb:77:in `reset!' 
     /home/arkiver/.rvm/gems/[email protected]/gems/capybara-2.1.0/lib/capybara.rb:245:in `block in reset_sessions!' 
     /home/arkiver/.rvm/gems/[email protected]/gems/capybara-2.1.0/lib/capybara.rb:245:in `each' 
     /home/arkiver/.rvm/gems/[email protected]/gems/capybara-2.1.0/lib/capybara.rb:245:in `reset_sessions!' 
     /home/arkiver/.rvm/gems/[email protected]/gems/capybara-2.1.0/lib/capybara/cucumber.rb:10:in `After' 

需要幫助搞清楚我在這裏丟失了什麼。

回答

0

我解決了這個問題。

https://code.google.com/p/chromedriver/downloads/list,我下載該版本:

「chromedriver_linux64_26.0.1383.0.zip ChromeDriver服務器LINUX64」

而不是我先前選擇的我使用了錯誤的驅動程序版本爲(意外?) :

問題解決了 「ChromeDriver2 r195627發佈的chromedriver2_linux64_0.8.zip版本」。

0

我有同樣的問題。在我的情況下,我有最新的驅動程序,但我需要更新我使用到最新版本的硒寶石。