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

212
Views
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 answers
Answer question

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 Report
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!