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) {
'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
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