Winium.Desktop icon indicating copy to clipboard operation
Winium.Desktop copied to clipboard

Only one usage of each socket address (protocol/network address/port) is normally permitted

Open singhbrijyot91 opened this issue 5 years ago • 1 comments

Constantly getting the same error while just trying to launch my thick client application through Winnium. My application has WinForms/WPF. Same code works on Calculator but does not works on the application I am working on. The exception that I get is below :

Starting Windows Desktop Driver on port 9999

16:51:53 [ERROR] SocketException occurred while trying to start listner: System.Net.Sockets.SocketException (0x80004005): Only one usage of each socket address (protocol/network address/port) is normally permitted at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at System.Net.Sockets.TcpListener.Start(Int32 backlog) at Winium.Desktop.Driver.Listener.StartListening() 16:51:53 [FATAL] Failed to start driver: System.Net.Sockets.SocketException (0x80004005): Only one usage of each socket address (protocol/network address/port) is normally permitted at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at System.Net.Sockets.TcpListener.Start(Int32 backlog) at Winium.Desktop.Driver.Listener.StartListening() at Winium.Desktop.Driver.Program.Main(String[] args)

Unhandled Exception: System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at System.Net.Sockets.TcpListener.Start(Int32 backlog) at Winium.Desktop.Driver.Listener.StartListening() at Winium.Desktop.Driver.Program.Main(String[] args) Oct 31, 2018 4:52:12 PM org.openqa.selenium.os.UnixProcess checkForError SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: -532462766 (Exit value: -532462766) Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start. Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06' System info: host: 'INVA621934', ip: '10.164.31.43', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131' Driver info: driver.version: unknown at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:178) at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:166) at com.fil.behaviourFin.desktop.Calculator.pocFMW(Calculator.java:64) at com.fil.behaviourFin.desktop.Calculator.main(Calculator.java:36) Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:27184/status] to be available after 20013 ms at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104) at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:175) ... 3 more Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143) at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79) ... 4 more Caused by: java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask.get(FutureTask.java:205) at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:130) ... 5 more

singhbrijyot91 avatar Oct 31 '18 11:10 singhbrijyot91

The driver session did not quit properly which is causing this error. You can end the process running the driver on port 9999 or you can open Winnium in new port.

Open command prompt and enter netstat -a -o -n which will display list of all active jobs

Get the PID for the job running on port 9999 and then run below command taskkill /F /PID ******

I know this is not best solution, but it helps

irshad413 avatar Jul 31 '20 16:07 irshad413