执行chromedriver时出错

时间:2015-04-21 23:54:41

标签: google-chrome selenium selenium-webdriver

当我尝试在Chrome中运行我的selenium脚本时出现此错误。我该如何纠正这个问题?

Starting ChromeDriver 2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3) on port 15264
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: unhandled inspector error: {"code":-32603,"message":"Cannot navigate to invalid URL"}
  (Session info: chrome=42.0.2311.90)
  (Driver info: chromedriver=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 8 milliseconds
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:03:00'
System info: host: 'snehagoutam', ip: '192.168.1.3', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.7.0_67'
Session ID: 3aeb08c890ad851258208cccb19dd435
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=WIN8_1, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\Users\Sneha\AppData\Local\Temp\scoped_dir7752_4467}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=42.0.2311.90, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, applicationCacheEnabled=false, takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
    at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:304)
    at Selenium.Test.main(Test.java:13)

2 个答案:

答案 0 :(得分:2)

您的错误消息明确说明:

unhandled inspector error: {"code":-32603,"message":"Cannot navigate to invalid URL"

检查您尝试访问的网址。

答案 1 :(得分:0)

网址首先需要http://。这为我修好了。