LoginSignup
5
4

More than 5 years have passed since last update.

Selenium WebDriver "Unable to connect to host" エラー

Last updated at Posted at 2015-05-14

環境

  • PC (OS:Windows7)
  • Firefox (ver 37.0.2)
  • Java (1.7)
  • Selenium WebDriver (2.42.2)

エラー

  • WebDriverからFirefoxを起動する際、下記エラーが発生。

    org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
    

対応

  • 下記の参考ページによると、WebDriverのバージョンがFirefoxのバージョンに対応していない場合に上記のエラーが出るとのこと。

  • 暫定回避としてFirefoxのバージョンダウン(ver 37 → 30)を実施。

  • Firefox ver 37をアンイストールし、下記ページから "Firefox Setup 30.0.exe" を落としてきてインストール。("Firefox Setup Stub 30.0.exe" の方は動きませんでした)
    Firefox ver 30 インストーラー

注意

  • Firefoxはデフォルトで自動verupするので下記のように設定を変えておきます。
    メニューから[ツール]-[オプション]-[詳細]-[更新]-[Firefoxの更新]と辿って、
    "更新の確認は行うが、インストールするかどうかを選択する" を選択。
  • 本来は自動verupが望ましいのですが、Firefoxが最新になったときに必ずしもWebDriverの対応バージョンがあるとは限らないので、日々の自動テストを安定して行うには上記の設定が良いと思われます。

参考にしたページ

5
4
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
5
4