0

I'm trying to capture the web page from header to footer in one screenshot. I tried code below:

IWebDriver driver;
string URI = "http://stackoverflow.com/questions/32883818/how-to-capture-screenshot-of-entire-scrolling-webpage-using-c-sharp";

IWebElement iElement;

[TestInitialize]
public void Init() 
{
    driver = new InternetExplorerDriver();
    driver.Manage().Window.Maximize();
    driver.Navigate().GoToUrl(URI);
}

[TestMethod]
public void Automate() 
{
    for (int second = 0;; second++) 
    {
        if (second >= 60) 
            break;
        
        driver.ExecuteScript("window.scrollBy(0,150)", "");

        Thread.Sleep(1000);
    }       
}

Please tell me how to capture the screen till the end in one Image.

Note: Its obvious screenshot get captured but not the entire screen. Some of the upper module of webpage didn't got capture only half of the page got captured, and this is the issue which I am facing. Please pull me out from this issue.

Jackdaw
  • 7,626
  • 5
  • 15
  • 33
s.shaikh
  • 1
  • 2
  • 2
    Possible duplicate of [Selenium WebDriver C# Full Website Screenshots With ChromeDriver and FirefoxDriver](http://stackoverflow.com/questions/16795458/selenium-webdriver-c-sharp-full-website-screenshots-with-chromedriver-and-firefo) – JeffC Jul 20 '16 at 15:23
  • I have gone through the required link present over thr but i didn't find my exact solution yet.... my query is bit different...yeah... its obvious screenshot get captured but not the entire screen, some of the upper module of webpage didn't got capture only half of the page got captured, and this is the issue which i m facing. Please pull me out from this issue. – s.shaikh Jul 21 '16 at 05:39

0 Answers0