我正在尝试使用 webdriver 启动 chrome 浏览器(版本 26.0)。我收到以下错误消息。
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver.
at com.google.common.base.Preconditions.checkState(Preconditions.java:176)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:69)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:107)
at googleSearch.main(googleSearch.java:13)
我使用的代码:
driver = new ChromeDriver();
driver.navigate().to("http://www.google.com/");
我使用 mac 10.8.2。