title: Access chromes window.performance from Protractor test
body: <p>I would like to track memory usage in a Protractor test by accessing the </p>
  
  <pre><code>window.performance.memory object.
  </code></pre>
  
  <p>I have added the necessary flag to to the protractor.conf.js  by adding</p>
  
  <pre><code>capabilities: {
      browserName: 'chrome',
      chromeOptions: {
          args: ['enable-memory-info'],
  </code></pre>
  
  <p>And I can access the memory object via the above command. My question is how to access the window object from the protractor test itsself?</p>
  
  <p>I have tried:</p>
  
  <pre><code>element(by.id('window')).then(function(win){
          theWindow = win;
          console.log("Set the window: " + theWindow);
          var mem = win.performance.memory;
          console.log("Memory: " + mem);
  </code></pre>
  
  <p>but this selector seems to be unavailable with this error:</p>
  
  <pre><code>NoSuchElementError: No element found using locator: By.id("window")
  </code></pre>
  
  <p>What options do I have in Protractor to access the browser window ? I have also tried the advice given here <a href="https://stackoverflow.com/questions/26102132/access-window-object-browser-scope-from-protractor">Access window object / browser scope from protractor</a>, but had no success in getting the memory object.</p>