-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Description
var webDriver = RemoteWebDriver.builder().address(REMOTE_URL).build()
In the above code when there is an exception in the build() method, no webDriver instance returned and I cannot release the underlaying HttpClient resources. Could we consider releasing the HttpClient resources inside the build() before throwing an exception?
The exception example :
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: java.io.IOException: Proxy-Authenticate header missing for response code 407
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
at org.openqa.selenium.remote.RemoteWebDriverBuilder.getRemoteDriver(RemoteWebDriverBuilder.java:394)
at org.openqa.selenium.remote.RemoteWebDriverBuilder.build(RemoteWebDriverBuilder.java:366)
Reproducible Code
var webDriver = RemoteWebDriver.builder().address(REMOTE_URL).build()Debugging Logs
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: java.io.IOException: Proxy-Authenticate header missing for response code 407
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
at org.openqa.selenium.remote.RemoteWebDriverBuilder.getRemoteDriver(RemoteWebDriverBuilder.java:394)
at org.openqa.selenium.remote.RemoteWebDriverBuilder.build(RemoteWebDriverBuilder.java:366)