2015-04-21 104 views
1

當我嘗試在Chrome中運行我的硒腳本時出現此錯誤。我應該如何糾正這個問題?執行chromedriver時出錯

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) 
+0

請分享您的代碼 – Saifur

回答

2

你的錯誤信息清清楚楚地寫着:

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

檢查您是否試圖擊中的URL。

+0

是的更正了。現在正在工作。謝謝 – Sneha

+0

@Sneha - 您應該將此答案標記爲解決方案。 (點擊答案左邊的複選框大綱。)另外,您應該對任何提供有用信息的答案進行投票。 –

+0

我現在不能投票,因爲我仍然必須獲得15點聲望 – Sneha

0

URL在開始時需要http://。這爲我修好了。