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.