LoginSignup
0
1

More than 5 years have passed since last update.

selenium-java-3.0.1でFireFoxが動かなったときにやったこと(geckodriver)

Last updated at Posted at 2016-12-22

環境

OSX 10.11.6
Eclipse neon

事象

Selenium WebdriverのEclipse環境を構築するため、こちらの記事が非常にわかりやすかったので難なく環境は出来たのですが、いざFireFoxを動かそうとするとエラーが発生して困りました。

エラー内容

Exception in thread "main" java.lang.IllegalStateException:
 The path to the driver executable must be set by the webdriver.gecko.driver 
system property; for more information, see https://github.com/mozilla/geckodriver. 
The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
・・・

対処

「geckodriverないぞ」とのことなので、geckodriverなんて聞いたことないけどまあそう言われてるんだから素直に探そうということで、下記に行き着き素直にMac用のをダウンロードしました。

https://github.com/mozilla/geckodriver/releases

そしてJavaのシステムプロパティでPATHを通します。

System.setProperty("webdriver.gecko.driver", "/(geckodriverの格納場所)/geckodriver");

そして再実行すると、、、

結果

無事動きました。
素直って大切ですね。

0
1
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
0
1