2

How do I deal with below exception. I am using selenium v3.141.59 and geckodriver v0.26 and firefox v65.0. I am getting the same exception for chrome as well.

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)
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 2
    ????? doesn't look like a valid port to me... – maio290 Jun 30 '20 at 07:57
  • For better help sooner, [edit](https://stackoverflow.com/questions/62652720/exception-in-thread-main-org-openqa-selenium-webdriverexception-java-io-ioexc#) to add a [mre] or [Short, Self Contained, Correct Example](http://www.sscce.org). – yur Jun 30 '20 at 07:58

2 Answers2

0

It looks like your port is: ?????

You should point to your application port (if you are on a custom port (not 80 or 443))

Check you application port:

Windows:

CMD -> netstat -a

Check the listening ports.

Linux:

Terminal -> netstat -tlnp

Check the listening ports.

Default web traffic runs on port 80 (Unencrypted) 443 (encrypted). You can troubleshoot the selenium by trying to visit https://duckduckgo.com instead of your localhost.

Check the documentation according to the language you are writing and check if the basics are in order. https://www.selenium.dev/documentation/en/

Krogh
  • 106
  • 5
0

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 i.e. Firefox Browser session.

As per the discussion in Unable to parse URL: http://localhost:????/session this error is observed due to incompatible comptuer language settings.


Solution

This issue can be addressed by setting the localhost language as Standard English.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352