I'm running tests on a Remote Machine through Azure daily scheduled run. Some of the tests are failing with below error log. How can I fix this ?
Note : I do not have method implementation of launching chrome driver as I am referencing dll of other solution which has abstract methods.
Stack : NUnit, C#, Selenium, Visual Studio, Azure, log4Net
OneTimeSetUp: Automation.Test.Framework.Models.Exceptions.AtGenericException : Error initializing WebDriver Chrome ----> System.InvalidOperationException : unknown error: Runtime.evaluate threw exception: DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. at :1:1 (Session info: chrome=77.0.3865.90) (Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 6.3.9600 x86_64)
This error message...
OneTimeSetUp: Automation.Test.Framework.Models.Exceptions.AtGenericException : Error initializing WebDriver Chrome
System.InvalidOperationException : unknown error: Runtime.evaluate threw exception: DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. at :1:1 (Session info: chrome=77.0.3865.90)
(Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 6.3.9600 x86_64)
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
Supports Chrome v63-65
Supports Chrome version 77
So there is a clear mismatch between the ChromeDriver v2.36 and the Chrome Browser v77.0
Ensure that:
@Test
as non-root user.driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.