Azure DevOps is triggering and running tests on a VM.
All my tests are working fine on local machine.
On VM, While trying to launch Chrome browser using ChromeDriver and WebDriverManager, tests are failing at LaunchChromeDriver method with failure as 'Access is Denied' at step new ChromeDriver(options);
This is how the method looks like:
public static IWebDriver LaunchChromeDriver()
{
try
{
new WebDriverManager.DriverManager().SetUpDriver(new ChromeConfig());
ChromeOptions options = new ChromeOptions();
driver = new ChromeDriver(options);
return driver;
}
catch(Exception e)
{
log.info("Exception is "+e);
return null;
}
}
am i missing something or do i need to modify the code ? Did anyone experienced the same ?
Getting an exception as below:
System.ComponentModel.Win32Exception (0x80004005): Access is denied at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at OpenQA.Selenium.DriverService.Start() at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
You should specify the chromedriver.exe executable file path:
driver = webdriver.Chrome(executable_path=r"C:\Chrome\chromedriver.exe")
For Windows, Allow Read & Execute Permissions on chromedriver.exe for Everyone:
For Linux:
User contributions licensed under CC BY-SA 3.0