playwright-java: [Question] FullPageScreenshot is not capturing the full page
Hi - I have the following script to capture the full page screenshot
@Test
public void googleTest(){
Playwright playwright = Playwright.create();
BrowserType.LaunchOptions launchOptions = new BrowserType.LaunchOptions();
launchOptions.setHeadless(false)
.setChannel(BrowserChannel.CHROME);
Browser browser = playwright.chromium().launch(launchOptions);
BrowserContext browserContext = browser.newContext();
Page page = browserContext.newPage();
page.navigate("https://google.com");
page.click("text=I agree");
System.out.println(page.title());
page.screenshot(new Page.ScreenshotOptions()
.setPath(Paths.get("colosseum-pixel2.png"))
.setFullPage(true)
);
}
The script runs fine and it takes the screenshot at the end. But the screenshot is not full page. Please refer attached the screenshot.

I am running this script using Playwright 1.10.0 OS - Ubuntu 20.04.2
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (9 by maintainers)
Below is a simple test (using 1.11.0) that illustrates the issue.
Here’s the images outputted: https://imgur.com/a/O3C0Dw7
I can confirm that this is happening. It looks like the viewport gets squashed right before the screenshot is rendered
I get the below output
*-display
description: VGA compatible controller product: UHD Graphics 620 vendor: Intel Corporation physical id: 2 bus info: pci@0000:00:02.0 version: 07 width: 64 bits clock: 33MHz capabilities: pciexpress msi pm vga_controller bus_master cap_list rom configuration: driver=i915 latency=0 resources: irq:134 memory:b0000000-b0ffffff memory:a0000000-afffffff ioport:4000(size=64) memory:c0000-dffff
Sorry for the confusion. In headful mode (launchOptions.setHeadless(false)) passing “–use-gl=swiftshader” also doesn’t solves the problem regardless of ‘’‘setFullPage’‘’ value