Enable the collection of performance metrics in the browser.

enablePerformanceMetrics() is only available when using Chrome or Edge drivers.

Usage

.enablePerformanceMetrics([enable], [callback])

Parameters

Name Type description
enable
Optional
boolean

Optional Whether to enable or disable the performance metrics collection. Default: true

callback
Optional
function

Optional callback function to be called when the command finishes.

Example

 this.demoTest = function (browser) {
   browser
     .enablePerformanceMetrics()
     .navigateTo('https://www.google.com');
     .getPerformanceMetrics((metrics) => {
       console.log(metrics);
      });
 };

Recommended content