Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTools Page.captureScreenshot endpoint is inconsistent (fails > 50%) #5762

Open
pes10k opened this issue Aug 22, 2019 · 2 comments
Open

DevTools Page.captureScreenshot endpoint is inconsistent (fails > 50%) #5762

pes10k opened this issue Aug 22, 2019 · 2 comments

Comments

@pes10k
Copy link
Contributor

@pes10k pes10k commented Aug 22, 2019

The above should reproduce, as of nightly and stable


/*
const process = require('process');
process.env.DEBUG = 'puppeteer:*';
process.env.DEBUG_COLORS = '1';
*/

const path = require('path');
const fs = require('fs').promises;

const sleep = require('await-sleep');
const puppeteer = require('puppeteer-core');

(async () => {
  console.log('Launching browser...');
  const browser = await puppeteer.launch({
    executablePath: '/usr/bin/brave-browser-nightly',
    args: [
      /*
      '--enable-logging=stderr',
      '--v=1',
      */
      '--disable-brave-update'
    ],
    /*
    dumpio: true,
    */
    headless: false
  });

  console.log('Opening new tab...');
  const page = await browser.newPage();

  console.log('Navigating to page...');
  await page.goto('https://smartads.lt/');

  console.log('Waiting...');
  await sleep(1000 * 15);

  console.log('Taking screenshot...');
  const screenshot = await page.screenshot();

  console.log('Saving screenshot...');
  await fs.writeFile('screenshot.png', screenshot);

  console.log('Done')
})();
@rebron
Copy link
Collaborator

@rebron rebron commented Aug 23, 2019

Does this need QA? Sounds like screenshots aren't working in certain cases?

@pes10k
Copy link
Contributor Author

@pes10k pes10k commented Aug 24, 2019

This is only when going through puppeteer (or other programatic devtools interfaces). This is distinct from user facing screenshot tools in the devtools UI (if they exist, im not sure).

And not certain cases, seems totally intermittent

Q/A would be great, but would need someone with at least some development skills, since youd need puppeteer and (a little) node experience to reproduce

@rebron rebron added the priority/P4 label Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.