的一段代碼是:獲得一個UnreachableBrowserException同時使用ChromeDriver
另一個編輯:想請注意,我用java實現這個,所以我不認爲斜線將是一個問題。 (雖然糾正我,如果我錯了)
編輯:還有一點我想補充的是,它實際上說,它的啓動鉻驅動程序版本的東西,但立即出現故障時
System.setProperty("webdriver.chrome.driver", "webdrivers/chromedriver.exe");
driver = new ChromeDriver();
後和我最終會得到的錯誤是
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.37.0', revision: 'a7c61cb', time: '2013-10-18 17:15:02'
System info: host: '****-PC', ip: '10.10.10.1', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_51'
沒有堆棧跟蹤,這發生在webdriver嘗試啓動後立即發生。我猜測上面的代碼是它發生的地方,因爲netbeans並沒有真正指出它出錯的地方。
神祕的是,這在我的電腦上工作,但試圖在同事的電腦上運行它只是產生這個錯誤。 Firefox適用於她,但IE和Chrome都是這樣。有任何想法嗎?
編輯:顯然有一個堆棧跟蹤:
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:165)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:62)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
... 7 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:8891/status] to be available after 20002 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:163)
... 9 more
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79)
... 10 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:201)
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:130)
... 11 more
當dbl單擊它時直接執行chromedriver.exe會發生什麼情況?你有什麼錯誤呢? – Faiz
它只是說在cmd窗口中啓動驅動程序。沒有別的之後 – axidus1989