facebook / memlab

A framework for finding JavaScript memory leaks and analyzing heap snapshots
https://facebook.github.io/memlab/
MIT License
4.35k stars 118 forks source link

How to use memlab in websites which requires login credentials #56

Closed deepankarn closed 1 year ago

deepankarn commented 1 year ago

let theUrlAfterLogin;

async function beforeInitialPageLoad(page) { await page.goto("https://XYZ"); // input login credentials and get the url after login is successful await page.waitForSelector('input[id=userNameInput]'); await page.$eval('#userNameInput', el => el.value = 'tw\schuser1');
await page.waitForSelector('input[id=passwordInput]'); await page.$eval('#passwordInput', el => el.value = 'xxxxx'); await page.click('[id="submitButton"]'); theUrlAfterLogin = "https://XYZ" //URL is same as page.goto }

function url() { return theUrlAfterLogin; }

// action where we want to detect memory leaks async function action(page) {

}

// action where we want to go back to the step before async function back(page) {

}

module.exports = {beforeInitialPageLoad, action, back, url};

MEMLAB Output

'command' is not recognized as an internal or external command, operable program or batch file. Cannot read property 'startsWith' of undefined total time: 905ms snapshot meta data invalid or missing

JacksonGL commented 1 year ago

Duplicate of #55