LoginSignup
9
7

More than 5 years have passed since last update.

【TravisCI】Firefoxとの接続エラー(unable to obtain stable firefox connection)がでるときの対処法

Last updated at Posted at 2014-07-16

はじめに

  • 「これ忘れることあるだろうなぁ!!」と思い技術メモに残しました

やりたかったこと

  • ローカルの環境で実行していたSeleniumのブラウザテストをTravis上での実行に移行しようと思った
  • ローカルのマシンではJenkinsで実行していたため、それを.travis.ymlへ移すだけのはずと
  • ヘッドレスで実行

実行してみて発生したエラー

  • 以下のエラーがでた
    • unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)
  • 60秒待ったがFirefoxとの接続ができなかったといわれる

対処法というより、設定が足りていなかった!!

  • .travis.ymlに以下を追加すると成功するようになった
    • sleepは挟まなくても問題ないようでしたが、必要に応じていれるのもありかと
.travis.yml
before_script:
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - sleep 5

~ただの宣伝~

  • 全国のSeleniumer必読
  • Seleniumerといっていますが、Selenium, SauceLabs, Travis, Jenkinsに関するノウハウ書いているのでよかったら参考にしてみてください
9
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
7