2017-05-16 38 views
0

我想修復我的硒和geckodriver錯誤Cloud9使用水豚和launchy。如何在Cloud9上修復我的硒和geckodriver錯誤?

當我嘗試使用Rspec進行功能測試時,發生錯誤。

的錯誤說,下面

Failure/Error: visit root_path 
    Selenium::WebDriver::Error::WebDriverError: 
     not a file: "/home/ubuntu/bin/geckodriver" 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver/common/platform.rb:125:in `assert_file' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver/common/platform.rb:129:in `assert_executable' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver/common/service.rb:60:in `binary_path' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver/common/service.rb:49:in `initialize' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver/firefox/w3c_bridge.rb:40:in `new' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver/firefox/w3c_bridge.rb:40:in `initialize' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver/common/driver.rb:52:in `new' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver/common/driver.rb:52:in `for' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/selenium-webdriver-3.4.0/lib/selenium/webdriver.rb:88:in `for' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/capybara-2.4.4/lib/capybara/selenium/driver.rb:13:in `browser' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/capybara-2.4.4/lib/capybara/selenium/driver.rb:45:in `visit' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/capybara-2.4.4/lib/capybara/session.rb:227:in `visit' 
    # /usr/local/rvm/gems/ruby-2.1.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>' 
    # ./spec/support/features/about_us_spec.rb:6:in `block (2 levels) in <top (required)>'`enter code here` 

名單是我試圖解決這些問題的挑戰。

①installgeckodriver

git clone https://github.com/mozilla/geckodriver 

②givegeckodriver路徑

export PATH=$PATH:/path/to/geckodriver 

這是我自己的環境。

ruby version 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux] 
rails version 4.1.1 

gem lists 
    * actionmailer (4.1.1) 
    * actionpack (4.1.1) 
    * actionview (4.1.1) 
    * activemodel (4.1.1) 
    * activerecord (4.1.1) 
    * activesupport (4.1.1) 
    * addressable (2.5.1) 
    * arel (5.0.1.20140414130214) 
    * bcrypt (3.1.11) 
    * bootstrap-sass (3.1.1.1) 
    * builder (3.2.3) 
    * bundler (1.14.6) 
    * capybara (2.4.4) 
    * capybara-webkit (1.14.0) 
    * childprocess (0.7.0) 
    * coffee-rails (4.0.1) 
    * coffee-script (2.4.1) 
    * coffee-script-source (1.12.2) 
    * database_cleaner (1.3.0) 
    * diff-lcs (1.3) 
    * erubis (2.7.0) 
    * execjs (2.7.0) 
    * factory_girl (4.4.0) 
    * factory_girl_rails (4.4.1) 
    * faker (1.4.3) 
    * ffi (1.9.18) 
    * hike (1.2.3) 
    * i18n (0.8.1) 
    * jbuilder (2.6.4) 
    * jquery-rails (3.1.4) 
    * json (1.8.6) 
    * launchy (2.4.3) 
    * mail (2.5.4) 
    * mime-types (1.25.1) 
    * mini_portile2 (2.1.0) 
    * minitest (5.10.2) 
    * multi_json (1.12.1) 
    * nokogiri (1.7.2) 
    * polyglot (0.3.5) 
    * public_suffix (2.0.5) 
    * rack (1.5.5) 
    * rack-test (0.6.3) 
    * rails (4.1.1) 
    * railties (4.1.1) 
    * rake (12.0.0) 
    * rdoc (4.3.0) 
    * rspec-core (3.1.7) 
    * rspec-expectations (3.1.2) 
    * rspec-mocks (3.1.3) 
    * rspec-rails (3.1.0) 
    * rspec-support (3.1.2) 
    * rubyzip (1.2.1) 
    * sass (3.2.19) 
    * sass-rails (4.0.5) 
    * sdoc (0.4.2) 
    * selenium-webdriver (3.4.0) 
    * spring (1.7.2) 
    * sprockets (2.12.4) 
    * sprockets-rails (2.3.3) 
    * sqlite3 (1.3.13) 
    * thor (0.19.4) 
    * thread_safe (0.3.6) 
    * tilt (1.4.1) 
    * treetop (1.4.15) 
    * turbolinks (5.0.1) 
    * turbolinks-source (5.0.3) 
    * tzinfo (1.2.3) 
    * uglifier (3.2.0) 
    * websocket (1.2.4) 
    * xpath (2.0.0) 

我想知道如何解決它們。 是否有可能使用水豚和硒的Firefox,Chrome和IE瀏覽器測試?

回答