Webdriver fails to take screenshot randomly
Hello. We are using Chrome v 31.0.1650.57 (we can't update to newer versions) and Selenium Web Driver v 2.53
At the end of our interface tests, we register a screenshot. The problem is that some tests fail to register the screenshot. (We are not using the incognito mode). We cannot trace or reproduce the error. The same test that had this error, when runned alone, works fine. The same tests that had this error, when runned again with all tests, works fine, but then other test at random have this issue. We tried everything we could find, but we are stuck into this. Can't find a solution anywhere. We thought that the driver was closing the browser before taking the screenshot, but I when I tried to close manually the browser and take the screenshot, it gave me a different error.
If possible, help us with this issue. This is the error: (It's in asp.Net)
System.InvalidOperationException : unknown error: cannot take screenshot from unknown error: Internal error while trying to capture visible region of the current tab JavaScript stack: Error: Internal error while trying to capture visible region of the current tab at checkForExtensionError (chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/background.js:14:17) at Object.callback (chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/background.js:37:5) at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14) at safeCallbackApply (extensions::sendRequest:22:15) at handleResponse (extensions::sendRequest:77:7) (Session info: chrome=37.0.2062.124) (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.3 x86_64) +++++++++++++++++++ STACK TRACE: at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.GetScreenshot()
Repeating: Not in incognito mode, not the test error (because the test works), and happens randomly.
Thanks.
This is a bug in the chromedriver and should be reported directly to the chromedriver project:
https://bugs.chromium.org/p/chromedriver/issues/list