2

I'm using puppeteer for my E2E testing on Linux/Mac. Works like a charm, but for debugging purposes I would like to use DevTools. I start the browser as follows

 const browser = await puppeteer.launch({
     ignoreHTTPSErrors: true,
     headless: false,
     devtools: true,
     dumpio: true,
     args: [
         `--disable-extensions-except=${EXTENSION_PATH}`,
         `--load-extension=${EXTENSION_PATH}`,
         '--user-agent=PuppeteerAgent',
         '--disable-infobars',
         '--no-sandbox',
         '--disable-setuid-sandbox',
    ],
    ...(slowMo && { slowMo }),
 });

Unfortunate, dumpio doesn't seem to do much, I expected to see my console.log messages in the terminal (but maybe it is not supposed to do this). But anyway, what would really help me is if I could open DevTools (which I already can) but instead of selecting the Element tab I would like top open by default the Console tab. Is something like this possible?

Something that would be nice too, is to enable Preserve log!

Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333

0 Answers0