Capture outgoing network calls from the browser.

Usage

.captureNetworkRequests(callback)

Parameters

Name Type description
callback function

callback function to be called whenever a outgoing network call is made.

Example

 this.demoTest = function (browser) {
   this.requestCount = 1;
   browser
     .captureNetworkRequests((requestParams) => {
       console.log('Request Number:', this.requestCount++);
       console.log('Request URL:', requestParams.request.url);
       console.log('Request method:', requestParams.request.method);
       console.log('Request headers:', requestParams.request.headers);
     })
     .navigateTo('https://www.google.com');
 };