1

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)

  • Check permissions on folder where chromium is located. – Prome Nov 4 at 13:12
0

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:

  1. Right Click chromedriver.exe > Properties On ChromeDriver
  2. On ChromeDriver Properties Window > Security Tab, click Edit
  3. On Permissions for ChromeDriver Window > Security tab, click Add
  4. On Select Users window, set name to Everyone and click OK button
  5. On Permissions for ChromeDriver Window > Security tab, make sure Read & Execute box is checked & click OK button
  6. On ChromeDriver Properties Window, click OK button

enter image description here

For Linux:

  1. Check you have installed latest version of chrome browser-> "chromium-browser -version"
  2. If not, install latest version of chrome "sudo apt-get install chromium-browser"
  3. Get the appropriate version of chrome driver from http://chromedriver.storage.googleapis.com/index.html
  4. Unzip the chromedriver.zip
  5. Move the file to /usr/bin directory sudo mv chromedriver /usr/bin
  6. Goto /usr/bin directory and you would need to run something like "chmod a+x chromedriver" to mark it executable.
  7. finally you can execute the code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.