Playwright , How to send parameterised values such as username, password , url from command line?

21 views Asked by At

playwright, ts and cucumber are the tools used for my framework

Playwright website methods have tried what says in playwright website too

in element.ts

await pageFixture.page.goto(process.env.BASE_URL as string);
await pageFixture.page.locator('input[type=text]').fill(process.env.USER_NAME as string);
await pageFixture.page.locator('input[name=passwd]').fill(process.env.PASSWORD as string);

typescript file command line parameters BASE_URL=https://test.xx.xxx/ USER_NAME=xxxdc.com.au PASSWORD=xcsxxx npm run test

throwing error in windows, vscode

is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • BASE_URL=

could someone help what wrong in the code??

,.....................................................................................................................................

0

There are 0 answers