-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
I have used the below snippet to take the full screenshot of https://www.dell.com/ko-kr website. However, the header part of the Dell website is missing in the screenshot. So when we run the below code, .shootpage with the Capture.Full property, the following happens with the web page:-
- Initially the page scrolls to the very bottom, step by step in the given intervals of
betweenScrollTimeOut. - Later the page scrolls nearly to the beginning of the page but not to the very beginning.
- The screenshot is captured from the current position.
As a result, some part of the page at the very beginning is not captured in the screenshot.
package org.example;
import com.assertthat.selenium_shutterbug.core.Capture;
import com.assertthat.selenium_shutterbug.core.Shutterbug;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
public class HighlightPage {
public static void main(String[] args) throws Exception {
ChromeOptions options = new ChromeOptions();
ChromeDriver driver = new ChromeDriver(options);
options.addArguments("--force-device-scale-factor=1");
options.addArguments("--remote-allow-origins=*");
driver.get("https://www.dell.com/ko-kr");
driver.manage().window().maximize();
Thread.sleep(12000);
BufferedImage image = Shutterbug.shootPage(driver, Capture.FULL, 5000).getImage();
String destFile = org.apache.commons.lang3.StringUtils.joinWith(File.separator,
System.getProperty("user.home"), "images", "subfolder", "source.png");
ImageIO.write(image, "PNG", new File(destFile));
}
}
ActualPage

ShutterBug Screenshot

As you can see that the header with the Dell Technologies, Search box and Languages list are missing in the actual screenshot.
This is happening for most of the sites which have a sticky header, section or div tag.
Need a fix for this issue. Kindly resolve. Thanks in anticipation.
Metadata
Metadata
Assignees
Labels
No labels