我正在使用Cucumber的黃瓜在Jenkins服務器上運行自動化測試。一切工作正常與Firefox。但是,我遇到了設置Google Chrome和ChromeDriver的問題。我已經安裝了谷歌Chrome和ChromeDriver(移動chromedriver到usr/bin中/ chromedriver),但是當測試運行時,將錯誤通知:如何設置在Chrome上Jenkins服務器上運行的Cucumber的ChromeDriver路徑?
"Unable to find the chromedriver executable. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver."
下面是我在env.rb安裝Chrome瀏覽器的驅動程序:
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome, :switches =>
%w[--ignore-certificate-errors --disable-popup-blocking])
end
如何在register_driver時設置ChromeDriver路徑?有沒有人遇到過這個問題? 非常感謝。
你需要把鉻司機在'PATH'變量,你正在運行測試的機器上...你執行'回聲$ PATH「命令並檢查是否有chromedriver路徑。 – Paras