[英]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中的讨论,由于计算机语言设置不兼容,会观察到此错误。
This issue can be addressed by setting the localhost language as Standard English .可以通过将 localhost 语言设置为Standard English来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.