title: protractor is unable to open a new tab
body: <p>Could you please suggest what I am doing wrong that I am getting this very strange exception:</p>
  
  <p><strong>Failed: unknown error: 'name' must be a string   (Session info: chrome=53.0.2785.101)   (Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 3.13.0-100-generic x86_64)</strong></p>
  
  <pre><code>function ensureNumberOfTabs(numberOfTabs) {
    return this.browser.getAllWindowHandles()
      .then(function(handles) {
        return handles &amp;&amp; handles.length &gt;= numberOfTabs &amp;&amp; handles[numberOfTabs];
      });
  }
  
  this.openTab = function(index, timeout) {
    timeout = timeout || DEFAULT_WAIT_FOR_TIMEOUT;
    var thisBrowser = this.browser;
    var deferred = protractor.promise.defer();
  
    function errHandler(err) {
      deferred.reject(err);
    }
    //wait to open the tab
    thisBrowser.wait(ensureNumberOfTabs(index), timeout, 'waiting for opening tab #' + index);
    //switch to the tab
    thisBrowser.getAllWindowHandles().then(function(tabs) {
      var tab = tabs[index]; // this is your new window
      thisBrowser.switchTo().window(tab).then(function() {
        deferred.fulfill();
      }, errHandler);
    }, errHandler);
  
    return deferred.promise;
  };
  </code></pre>
  
  <p>As far as I understand I am actually checking that name has something by <code>&amp;&amp; handles[numberOfTabs];</code></p>
  
  <p>The problem, of course happens just sometimes...</p>
  
  <p>Any advice would be very welcomed:)</p>
  
  <p>This issue appears on node 6, protractor 4.0.11, chrome 53 and driver 2.25, on Ubuntu 14</p>