Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98798

How to take full page screenshot using AShot library through Selenium and Java

$
0
0

I tried the below code for taking full page screenshot. But only the visible area is captured,

public void Fullscreen (WebDriver driver) 
{
    try {
        final Screenshot screenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver);
        final BufferedImage image = screenshot.getImage();
        ImageIO.write(image, "PNG", new File("D:\\" + "AShot_BBC_Entire.png"));           
    } catch(Exception e){
        System.out.println(e.getMessage());
    }
}

Viewing all articles
Browse latest Browse all 98798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>