title: Run nightwatch in jessie through headless chrome
body: <p>I have started a jessie clean vps and then I installed node.js. After that I installed nightwatch and chromedriver through npm. I made 3 files, they are nightwatch.js, nightwatch.json, and js sample testing.</p>
  
  <p>Here is my nightwatch.json:</p>
  
  <pre><code>{
    "src_folders" : [""],
    "custom_commands_path" : "",
    "custom_assertions_path" : "",
    "page_objects_path" : "",
    "globals_path" : "",
  
    "selenium" : {
      "start_process" : true,
      "server_path" : "./selenium-server-standalone-3.0.1.jar",
      "log_path" : "",
      "host": "127.0.0.1",
      "port" : 4444,
      "cli_args" : {
        "webdriver.chrome.driver" : 
        "./node_modules/chromedriver/lib/chromedriver/chromedriver"
      }
    },
  
    "test_settings" : {
      "default" : {
        "launch_url" : "http://localhost",
        "selenium_port"  : 4444,
        "selenium_host"  : "localhost",
        "silent": true,
        "screenshots" : {
          "enabled" : false,
          "path" : ""
        },
        "desiredCapabilities": {
          "browserName": "chrome",
          "chromeOptions" : {
            "args" : ["headless", "--no-sandbox"]
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>And for sample testing, it's just a simple testing like this:</p>
  
  <pre><code>var chromedriver = require('chromedriver');
  module.exports = {
    before : function(done) {
      chromedriver.start();
    },
    after : function(done) {
      chromedriver.stop();
    },
    'Trial' : function (browser) {
      browser
        .url('http://www.google.com')
        .waitForElementVisible('body', 1000)
        .setValue('input[type=text]', 'nightwatch')
        .waitForElementVisible('button[name=btnG]', 1000)
        .click('button[name=btnG]')
        .pause(1000)
        .assert.containsText('#main', 'Night Watch')
        .end();
    }
  };
  </code></pre>
  
  <p>Here is what I got:
  <a href="https://i.stack.imgur.com/EZOoo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EZOoo.png" alt="enter image description here"></a></p>
  
  <p>And everytime I run the test, it seems like the headless browser doesn't work properly. Nightwatch cannot recognize every element. When I do .assert.title('Google'), it returns 'Object not found'. I have tested it on windows and it worked smoothly. Is there something that I miss? Is it necessary to use chrome binary when I run it headlessly?</p>