2
votes

I have a web api application. Some method of the application runs chromedriver and makes some actions (sucs as clicks and taking screenshots)

Under Visual Studio application works well. But when I publish my application to IIS, application throw Exception

Unexpected error. System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:51149 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

How to fix it?

I saw familar questions on StackOverflow, but I didn't find an answer.

2

2 Answers

1
votes

I faced the issue because driver .quit was in side a method that executed before last method call. Fixed by removing the driver.quit from the existing page object method and put at the end of test method. Started working perfectly

0
votes

I had many Chrome processes in task Manager. When I killed them, the application ran