public static IWebDriver UserMultiUserSignIn (IWebDriver driver, string port, string hostName, string password, string Username)
    string name = Dns.GetHostName();
    ChromeOptions Options = new ChromeOptions();
    Options.AddAdditionalCapability(Username, "USERNAME");
    Options.AddAdditionalCapability(password, "ACCESS_KEY");
    driver = new RemoteWebDriver(new Uri("http://"+hostName+":"+port+ "/wd/hub"), Options.ToCapabilities());            

    return driver;

public static void RemoteServerLogin ()
    string EMAUserName = System.Configuration.ConfigurationManager.AppSettings.Get("EMAUserName");
    string Password = System.Configuration.ConfigurationManager.AppSettings.Get("EMAPassword");
    string Port = System.Configuration.ConfigurationManager.AppSettings.Get("Port");
    string HostName = System.Configuration.ConfigurationManager.AppSettings.Get("Hostname");

    UserMultiUserSignIn(driver, Port, HostName, Password, EMAUserName);


OpenQA.Selenium.WebDriverException: '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 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) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo) at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)'

  • How do you start your webdriver?
    – wec
    Oct 30, 2019 at 14:15

1 Answer 1


With chrome the setup is a little different. I'd need more info to help. Were you able to connect before and it recently stopped? If so I would say to make sure you have the most up to date driver. Is this the initial setup?

  • It'd be better to post this kind of answer as a comment rather than an answer, because you have more questions than actual answers.
    – pavelsaman
    Dec 8, 2019 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.