はじめに
- Gebで不思議なエラーに悩まされた時の話です。
- Gebについてはぷーさにさんの記事が詳しいので割愛します。
codezine.jp
- Yokohama.groovy #42でGebについて学んだ後、ひさしぶりに動かしてみると全然動きません。
- 原因はブラウザのドライバーのバージョンが古かったからなのですが、エラーからは直接わからず…
- そこでバージョンが合っていないとどんなエラーが出るか試してみました(とりあえずChrome Driverだけ)。
その1
GebishOrgSpec > Gebのホームページが表示できる FAILED
geb.driver.DriverCreationException
Caused by: org.openqa.selenium.remote.UnreachableBrowserException
Caused by: org.openqa.selenium.WebDriverException
Caused by: org.apache.http.conn.HttpHostConnectException
Caused by: java.net.ConnectException
その2
GebishOrgSpec > Gebのホームページが表示できる FAILED
geb.driver.DriverCreationException
Caused by: org.openqa.selenium.SessionNotCreatedException
その3
GebishOrgSpec > Gebのホームページが表示できる FAILED
geb.driver.DriverCreationException at GebishOrgSpec.groovy:7
Caused by: org.openqa.selenium.WebDriverException at GebishOrgSpec.groovy:7
geb.driver.DriverCreationException
Caused by: org.openqa.selenium.WebDriverException
geb.driver.DriverCreationException
Caused by: org.openqa.selenium.WebDriverException
終わりに
- ひさしぶりにGebを動かしてみてよくわからないエラーが出たらドライバーのバージョンを疑ってみるのも1つかと思います。
- 明日はuehajさんです。よろしくお願いします!