在Jenkins構建完成後通過調用rake任務觸發黃瓜測試時,我無法啓動CI服務器上的瀏覽器(本例中爲Linux上的本地主機)。 Jenkins控制檯日誌如下。我非常確定一切正常,因爲我可以通過命令行在服務器上成功運行它。無法從Jenkins CI啓動瀏覽器
01:26:43 [cucumber] $ /usr/local/rvm/scripts/gems/ruby-2.3.0/bin/rake schedule_win_job:features --trace
01:26:43 ** Invoke schedule_win_job:features (first_time)
01:26:43 ** Execute schedule_win_job:features
01:26:43 /usr/local/rvm/scripts/rubies/ruby-2.3.0/bin/ruby -S bundle exec cucumber --tag @schedule_job --profile dev
**01:27:45 unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)**
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:90:in `connect_until_stable'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:55:in `block in launch'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/socket_lock.rb:43:in `locked'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:51:in `launch'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/bridge.rb:43:in `initialize'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/driver.rb:53:in `new'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/driver.rb:53:in `for'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver.rb:84:in `for'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/watir-webdriver-0.9.1/lib/watir-webdriver/browser.rb:46:in `initialize'
相同的答案:http://stackoverflow.com/questions/36917134/unable-to-run-automation-on-firefox-jenkins從今天早些時候 - 確保你有你的路徑上的Firefox 45。 – titusfortner
對不起,我已通過檢查並滿足您提及的所有要求,但問題仍然存在。如果我將瀏覽器更改爲Chrome瀏覽器,則會遇到此處報告的新問題[StackOverflow question](http://stackoverflow.com/questions/22558077/unknown-error-chrome-failed-to-start-exited-abnormally-driver- info-chromedri),那裏的解決方案也不適合我。 –
順便說一句,下面是我得到的錯誤消息,如果我嘗試通過Jenkins使用裸shell命令啓動firefox。 '[20:38:21]/usr/bin/firefox [20:38:21]錯誤:GDK_BACKEND與可用顯示不匹配# –