Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

302
Views
How to use MFA in playwright?

I tried using Persistent context approach from playwright website but its not working From the multi-factor-authentication docs

const { chromium } = require('playwright');
const userDataDir = '/path/to/directory';
const context = await chromium.launchPersistentContext(userDataDir
                                        , { headless: false });
// Execute login steps manually in the browser window

I used this code

describe("Learn Playwright", () => {
  test('basic test', async () => {
    const browser = await chromium.launch(
       { args: ['--disable-web-security',]
        ,headless: false
       });

    const userDataDir = 'user/data/dir';
    const context = await chromium.launchPersistentContext(userDataDir
                        , { headless: false });
    // Create a new page inside context.
    const page = await context.newPage();
    context.close
    })
});

but the file is not getting updated inside dir directory. If anyone can elaborate what is wrong here? It will be really helpful.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!