Takes a heap snapshot and saves it in JSON format serialized to string.
Load the snapshot file into Chrome DevTools memory tab to inspect.

Usage

.takeHeapSnapshot([heapSnapshotLocation], [callback])

Parameters

Name Type description
heapSnapshotLocation
Optional
string

Optional Location where you want to save the generated heap snapshot file.

callback
Optional
function

Optional callback function which is called with the heap snapshot serialized to string as argument.

Returns

Type description
string Heap snapshot serialized into string.

Example

 this.demoTest = function (browser) {
   browser
     .navigateTo('https://www.google.com')
     .takeHeapSnapshot('./snap.heapsnapshot');
 };