最近我想在jenkins上用chrome而不是firefox执行我的capybara测试用例。 (含硒2.39.0) 但是,在下载chrome版本48和chrome webdriver 2.20之后。我遇到了Jenkins以下的硒例外:
/var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/response.rb:51:in `assert_ok': unknown error: Chrome version must be >= 53.0.2785.0 (Selenium::WebDriver::Error::UnknownError)
(Driver info: chromedriver=2.25.426927 (d0803376130bda68eb594d02ebaca4609e3f899e),platform=Linux 3.5.0-23-generic x86)
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/response.rb:15:in `initialize'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/http/common.rb:59:in `new'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/http/common.rb:59:in `create_response'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/http/default.rb:66:in `request'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/bridge.rb:634:in `raw_execute'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/bridge.rb:99:in `create_session'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/chrome/bridge.rb:29:in `initialize'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/common/driver.rb:37:in `new'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/common/driver.rb:37:in `for'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver.rb:67:in `for'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/capybara-2.6.0/lib/capybara/selenium/driver.rb:13:in `browser'
from /var/lib/jenkins/workspace/test/srm-smokestack/spec/spec_helper.rb:289:in `<top (required)>'
from /var/lib/jenkins/workspace/test/srm-smokestack/spec/features/engage/common/engage_common_multiple_channels_spec.rb:1:in `require'
from /var/lib/jenkins/workspace/test/srm-smokestack/spec/features/engage/common/engage_common_multiple_channels_spec.rb:1:in `<top (required)>'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `each'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load_spec_files'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22:in `run'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in `run'
from /var/lib/jenkins/workspace/test/srm-smokestack/vendor/bundle/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in `block in autorun'
我只是不知道为什么我安装了chromedriver 2.20,但是selenium只是抛出异常:
Driver info: chromedriver=2.25.426927
如果我运行chromedriver -v,我确实会得到2.20节目:
ChromeDriver 2.20.353141 (da3cb4b52d3a04ce079546eac4dc96182f58602b)
运行哪个chromedriver,将返回到下面的位置,我已经将/ usr / local / bin导出到$ PATH:
/usr/local/bin/chromedriver