Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda