简体   繁体   English

Exception in thread “main” org.openqa.selenium.WebDriverException: java.io.IOException: Unable to parse URL: http://localhost:?????/session

[英]Exception in thread “main” org.openqa.selenium.WebDriverException: java.io.IOException: Unable to parse URL: http://localhost:?????/session

How do I deal with below exception.我该如何处理以下异常。 I am using selenium v3.141.59 and geckodriver v0.26 and firefox v65.0.我正在使用 selenium v3.141.59 和 geckodriver v0.26 和 firefox v65.0。 I am getting the same exception for chrome as well.对于 chrome,我也遇到了同样的例外情况。

Exception in thread "main" org.openqa.selenium.WebDriverException: java.io.IOException: Unable to parse URL: http://localhost:?????/session
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'HP', ip: '172.29.11.119', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_191'
Driver info: driver.version: FirefoxDriver
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
    at SeleniumDrivers.main(SeleniumDrivers.java:10)
Caused by: java.io.IOException: Unable to parse URL: http://localhost:?????/session
    at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:64)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)

It looks like your port is: ?????看起来您的端口是:?????

You should point to your application port (if you are on a custom port (not 80 or 443))您应该指向您的应用程序端口(如果您使用的是自定义端口(不是 80 或 443))

Check you application port:检查您的应用程序端口:

Windows: Windows:

CMD -> netstat -a CMD -> netstat -a

Check the listening ports.检查监听端口。

Linux: Linux:

Terminal -> netstat -tlnp终端-> netstat -tlnp

Check the listening ports.检查监听端口。

Default web traffic runs on port 80 (Unencrypted) 443 (encrypted).默认 web 流量在端口 80(未加密)443(加密)上运行。 You can troubleshoot the selenium by trying to visit https://duckduckgo.com instead of your localhost.您可以通过尝试访问https://duckduckgo.com而不是您的本地主机来对 selenium 进行故障排除。

Check the documentation according to the language you are writing and check if the basics are in order.根据您编写的语言检查文档,并检查基础知识是否有序。 https://www.selenium.dev/documentation/en/ https://www.selenium.dev/documentation/en/

This error message...此错误消息...

Exception in thread "main" org.openqa.selenium.WebDriverException: java.io.IOException: Unable to parse URL: http://localhost:?????/session
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'HP', ip: '172.29.11.119', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_191'
Driver info: driver.version: FirefoxDriver
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
    .
    .
Caused by: java.io.IOException: Unable to parse URL: http://localhost:?????/session

...implies that the GeckoDriver was unable to initiate/spawn a new Browsing Context ie Firefox Browser session. ...意味着GeckoDriver无法启动/产生新的浏览上下文,即Firefox 浏览器session。

As per the discussion in Unable to parse URL: http://localhost:????/session this error is observed due to incompatible comptuer language settings.根据Unable to parse URL: http://localhost:????/session中的讨论,由于计算机语言设置不兼容,会观察到此错误。


Solution解决方案

This issue can be addressed by setting the localhost language as Standard English .可以通过将 localhost 语言设置为Standard English来解决此问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 线程“主” org.openqa.selenium.WebDriverException中的异常:无法访问Chrome - Exception in thread “main” org.openqa.selenium.WebDriverException: chrome not reachable 线程“主”org.openqa.selenium.WebDriverException 中的异常:权限被拒绝 - Exception in thread “main” org.openqa.selenium.WebDriverException: permission denied 如何修复线程“主”org.openqa.selenium.WebDriverException 中的异常? - How to fix Exception in thread “main” org.openqa.selenium.WebDriverException? 线程“主” org.openqa.selenium.WebDriverException中的异常:未定义$ - Exception in thread “main” org.openqa.selenium.WebDriverException: $ is not defined 线程“ main”中的异常org.openqa.selenium.WebDriverException - Exception in thread “main” org.openqa.selenium.WebDriverException org.openqa.selenium.WebDriverException:java.io.IOException:使用GeckoDriver调用getCookies()时,连接上的流意外结束 - org.openqa.selenium.WebDriverException: java.io.IOException: unexpected end of stream on Connection while invoking getCookies() with GeckoDriver 线程“主”org.openqa.selenium.WebDriverException 中的异常:未知错误:使用 Selenium Java 的意外命令响应 - Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: unexpected command response using Selenium Java 线程“主”中的异常org.openqa.selenium.WebDriverException:java.net.SocketException:连接重置 - Exception in thread “main” org.openqa.selenium.WebDriverException: java.net.SocketException: Connection reset 线程“主” org.openqa.selenium.WebDriverException中的异常:未知错误:无法聚焦元素 - Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: cannot focus element 线程“main”中的异常 org.openqa.selenium.WebDriverException:驱动程序服务器进程过早死亡 - Exception in thread "main" org.openqa.selenium.WebDriverException: Driver server process died prematurely
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM