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

[BUG] Full-page screenshot in headful mode got replicated portions for website with big height #28834

Closed
wbeuil opened this issue Jan 2, 2024 · 1 comment

Comments

@wbeuil
Copy link

wbeuil commented Jan 2, 2024

Seems like the page.screenshot is not running exactly the same between headless and headful for websites with big height. The headful one got multiple replicated portions of the website, whereas the headless one is what I want. Please find below a way to replicate my issue.

System info

  • Playwright Version: v1.40.1
  • Operating System: macOS 14.2.1
  • Browser: Chromium

Source code

const playwright = require('playwright');

async function takeScreenshot(browser, path) {
  const url = "https://fr.wikipedia.org/wiki/Paris"
  const page = await browser.newPage()
  await page.goto(url)
  await page.screenshot({ path, fullPage: true })
  await page.close()
  await browser.close()
}

(async () => {
  const browser1 = await playwright.chromium.launch({ headless: true })
  await takeScreenshot(browser1, 'screenshot-1.png')
  const browser2 = await playwright.chromium.launch({ headless: false })
  await takeScreenshot(browser2, 'screenshot-2.png')
})()

Steps

  • Run the above code
  • Compare both screenshots

Expected

The full page website as the headless one.

Actual

The headful screenshot got replicated portions of the website.

@mxschmitt
Copy link
Member

mxschmitt commented Jan 2, 2024

Folding into #12683.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants