Enable/disable the collection of performance metrics in the browser. Metrics collection only begin after this command is called.

Usage

                    .enablePerformanceMetrics([enable], [callback])
                

Example

 describe('collect performance metrics', function() {
   it('enables the metrics collection, does some stuff and collects the metrics', function() {
     browser
       .enablePerformanceMetrics()
       .navigateTo('https://www.google.com')
       .getPerformanceMetrics((result) => {
         if (result.status === 0) {
           const metrics = result.value;
           console.log(metrics);
         }
       });
   });
 });

Parameters

Name Type description
enable
Optional
boolean

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

callback
Optional
function

callback function to be called when the command finishes.