I use Selenium 2 (Webdriver) on an ASP.NET website to create a service where users can enter their URL and get screenshots of the page taken using different browsers.
My page is the host on Windows Server 2008 R2.
FirefoxDriver screenshots using FirefoxDriver great. But when I use InternetExplorerDriver , I just get an empty black file.
The application works as an administrator - so there should be no problems with rights.
My code is:
// Opening the Browser var ieCapabilities = DesiredCapabilities.InternetExplorer(); ieCapabilities.SetCapability(InternetExplorerDriver.IntroduceInstabilityByIgnoringProtectedModeSettings, true); var browserIe = new InternetExplorerDriver(ieCapabilities); browserIe.Navigate().GoToUrl("http://www.google.com"); // Screenshot var dir = Server.MapPath("/screenshots/"); browserIe.GetScreenshot().SaveAsFile(dir + "Filename.png", ImageFormat.Png); browserIe.Close();
Any ideas why my file is black? THANKS!
source share