title: Connection refused! Is selenium server started
body: <p>I have inherited a project in work with no documentation. It is a sails.js application. 
  There is a small set of unit tests and an end-to-end test.</p>
  
  <p>When I try and run the end-to-end test using grunt. I get:</p>
  
  <pre><code>$ grunt e2e
  Running "nightwatch" task
  started - PID:  5440
  &gt;&gt; Executing "default" tests (standalone)
  
  [Index] Test Suite
  ==================
  
  Running:  Should clean the collection
  
  removing 0 places
  &gt;&gt; Connection refused! Is selenium server started?
  </code></pre>
  
  <p>I don't know what I could be  missing. This has me stuck for over a week.</p>
  
  <p><strong>The project has a <em>selenium-server-standalone-2.40.0.jar</em> in grunt-nightwatch. So I take the PID is the selenium server starting. If I start the jar first(outside of grunt) I get</strong></p>
  
  <pre><code>$ grunt e2e
  org.openqa.grid.selenium.GridLauncher main
  INFO: Launching a standalone server
  18:38:46.189 WARN - Failed to start: SocketListener0@0.0.0.0:4444
  Exception in thread "main" java.net.BindException: Selenium is already running on port 4444. Or     some other service is.
      at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:491)
      at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:300)
      at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245)
      at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:95)
  &gt;&gt; Could not start Selenium.
  </code></pre>
  
  <p>Here is the <strong>nightwatch.json</strong></p>
  
  <pre><code>{
    "src_folders" : ["tests/e2e"],
    "custom_commands_path" : "",
    "custom_assertions_path" : "",
    "globals_path" : "",
  
    "selenium" : {
      "start_process" : false,
      "server_path" : "",
      "log_path" : "",
      "host" : "127.0.0.1",
      "port" : 4444,
      "cli_args" : {
        "webdriver.chrome.driver" : "",
        "webdriver.ie.driver" : ""
      }  
    },
  
    "test_settings" : {
      "default" : {
        "launch_url" : "http://localhost",
        "selenium_port"  : 4444,
        "selenium_host"  : "localhost",
        "silent": true,
        "screenshots" : {
          "enabled" : false,
          "path" : ""
        },
        "desiredCapabilities": {
          "browserName": "chrome",
          "javascriptEnabled": true,
          "acceptSslCerts": true
        }
      },
  
      "chrome" : {
        "desiredCapabilities": {
          "browserName": "chrome",
          "javascriptEnabled": true,
          "acceptSslCerts": true
        }
      }
    }
  }
  </code></pre>
  
  <p>Huge thanks for any help!</p>
  
  <p>p.s. Am on a windows 7 box</p>