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

217
Vistas
playwright using indexedDB

is it possible to somehow interact with indexeddb ?

I want to test UI using test data in indexeddb.

I am using the code from the documentation https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory and I get the error

 indexedDB is not defined 
window is not defined
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Yes you can use page.evaluate to execute JavaScript inside your page: https://playwright.dev/docs/api/class-page#page-evaluate

// @ts-check
const playwright = require('playwright');

(async () => {
  // Try to add 'firefox' to the list ↓
  for (const browserType of [playwright.chromium, playwright.firefox, playwright.webkit]) {
    const browser = await browserType.launch();
    const context = await browser.newContext();
    const page = await context.newPage();
    await page.goto('https://example.org/');
    console.log(await page.evaluate(() => {
      return typeof window.indexedDB
    }));
    await browser.close();
  }
})();

Make sure to pass any values which you want to share from Node.js with the browser as a second argument, see here: https://playwright.dev/docs/next/evaluating

about 4 years ago · Juan Pablo Isaza Denunciar
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