Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

309
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda