无法在Mac上创建用于Geb测试的Google Chrome驱动程序

时间:2013-09-13 22:34:42

标签: macos grails selenium-chromedriver geb

我正在使用Geb来运行Grails功能测试。我想使用Chrome驱动程序,我按照以下说明操作: https://code.google.com/p/selenium/wiki/ChromeDriver

我在以下位置安装了Google Chrome驱动程序:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

在我的Mac上。

我用开关

运行测试
-Dwebdriver.chrome.driver="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
来自日食。

当我运行测试时,我得到:

Caused by: java.lang.IllegalStateException: The driver executable does not exist: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

如果我遗漏开关,我会得到:

The path to the driver executable must be set by the webdriver.chrome.driver system property; 

如果我遗漏了引号:

java.lang.IllegalStateException: The driver executable does not exist: /Applications/Google\

如果我保留引用并省略一些斜线

/Applications/Google Chrome.app/Contents/MacOS/Google Chrome

我明白了:

 org.openqa.selenium.WebDriverException: chrome not reachable
  (Driver info: chromedriver=2.3,platform=Mac OS X 10.8.3 x86_64) (WARNING: The server did not provide any stacktrace information)

任何想法?

1 个答案:

答案 0 :(得分:4)

首先,您需要安装 driverbrowser。然后webdriver.chrome.driver系统属性必须指向驱动程序,指向浏览器

相关问题