I would like to track memory usage in a Protractor test by accessing the
window.performance.memory object.
I have added the necessary flag to to the protractor.conf.js by adding
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['enable-memory-info'],
And I can access the memory object via the above command. My question is how to access the window object from the protractor test itsself?
I have tried:
element(by.id('window')).then(function(win){
theWindow = win;
console.log("Set the window: " + theWindow);
var mem = win.performance.memory;
console.log("Memory: " + mem);
but this selector seems to be unavailable with this error:
NoSuchElementError: No element found using locator: By.id("window")
What options do I have in Protractor to access the browser window ? I have also tried the advice given here Access window object / browser scope from protractor, but had no success in getting the memory object.