title: Getting Connection Refused Exception in the time of initializing Winium Driver
body: <p>i am new to winium technology, i tried to start my winium demo test i am getting exception like <code>org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException:</code>so can anyone please help me to solve this error.</p>
  
  <p>My demo code:</p>
  
  <pre><code>public static void main(String args[]) throws Exception{
  // TODO Auto-generated method stub
   String ApplicationPath="C:\\Windows\\System32\\notepad.exe";
   DesktopOptions options=new DesktopOptions();
   options.setApplicationPath(ApplicationPath);
   System.setProperty("webdriver.winium.driver.desktop", "C:\\Users\\DELL\\Downloads\\Winium.Desktop.Driver\\Winium.Desktop.Driver.exe");
   WiniumDriver driver=new WiniumDriver(new URL("http://localhost:9999"),options);
  </code></pre>
  
  <p>}</p>
  
  <p>///LogCat///</p>
  
  <pre><code>Exception in thread "main" org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9999 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
  Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
  System info: host: 'DESKTOP-S3RV3MH', ip: '192.168.1.3', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
  Driver info: driver.version: WiniumDriver
      at org.openqa.selenium.winium.WiniumDriverCommandExecutor.execute(WiniumDriverCommandExecutor.java:86)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
      at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
      at org.openqa.selenium.remote.RemoteWebDriver.&lt;init&gt;(RemoteWebDriver.java:142)
      at org.openqa.selenium.winium.WiniumDriver.&lt;init&gt;(WiniumDriver.java:84)
      at winium.demo.WiniumDemo1.main(WiniumDemo1.java:23)
  Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9999 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
      at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
      at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
      at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
      at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
      at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:138)
      at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:86)
      at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)
      at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
      at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
      at org.openqa.selenium.winium.WiniumDriverCommandExecutor.execute(WiniumDriverCommandExecutor.java:78)
      ... 5 more
  Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
      at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
      at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
      at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.SocksSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
      at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
      ... 20 more
  </code></pre>