Click here to Skip to main content
13,865,531 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have already the following code which is taking the screenshot of the visible page.
My goal is taking a full page screenshot instead .
Cal someone help me with this ?

What I have tried:

// please find below the Current code

public void TakeScreenshot(String path, String imgName)

Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();

//String dir = path;
String filepath = path;

if (!Directory.Exists(filepath))

ss.SaveAsFile(filepath + imgName + ".png", ScreenshotImageFormat.Png);

Updated 10-Aug-18 1:09am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try this,

public void TakeScreenshot(String url, String image)
	var driver = new InternetExplorerDriver();
	var ss = driver.GetScreenshot();
	ss.SaveAsFile(image, System.Drawing.Imaging.ImageFormat.Png);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190214.1 | Last Updated 10 Aug 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100