I am using selenium web driver 3.4.0. I have downloaded IEDriver.exe and copied to bin folder. I have an MVC application which will be working on taking the screenshot for given link. The link can be anything for any website. We need to take the screenshot for that webpage and store that into the PDF. Now, I have created the console application using C# and added WebDriver.dll. The application works fine when console application is called. The screenshot is taken.
When same code is called from the MVC web application, its taking the screenshot for web page but its black. Is there any reason for this?
var options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
var driver = new InternetExplorerDriver(options);
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl("URL TO BE BROWSED");
var screenshot = ((ITakesScreenshot)driver).GetScreenshot();
screenshot.SaveAsFile("Test.png", ScreenshotImageFormat.Png);
driver.Quit();