環境
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");
そして再実行すると、、、
結果
無事動きました。
素直って大切ですね。