title: Browser performance tests through selenium
body: <p>We are using <code>protractor</code> for testing internal AngularJS applications.</p>
  
  <p>Besides functional tests, we check for performance regressions with the help of <a href="http://npmjs.org/package/protractor-perf"><code>protractor-perf</code></a> which is based on nodejs <a href="https://github.com/axemclion/browser-perf"><code>browser-perf</code></a> library. Because, <a href="http://blog.codinghorror.com/performance-is-a-feature/">"Performance is a feature"</a>.</p>
  
  <p>With <code>protractor-perf</code> we can measure and assert different performance characteristics while making browser actions, <a href="http://blog.nparashuram.com/2014/11/protractor-perf-performance-regression.html">for example</a>:</p>
  
  <pre><code>browser.get('http://www.angularjs.org');
  
  perf.start(); // Start measuring the metrics
  element(by.model('todoText')).sendKeys('write a protractor test');
  element(by.css('[value="add"]')).click();
  perf.stop(); // Stop measuring the metrics 
  
  if (perf.isEnabled) { // Is perf measuring enabled ?
      // Check for perf regressions, just like you check for functional regressions
      expect(perf.getStats('meanFrameTime')).toBeLessThan(60); 
  };
  </code></pre>
  
  <hr>
  
  <p>Now, for an another internal application we have a set of selenium-based tests written in Python. </p>
  
  <p>Is it possible to check for performance regressions with selenium-python, or should I rewrite the tests using <code>protractor</code> to be able to write browser performance tests?</p>