Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error display unable to delete the file chromedriver.exe while running a Selenium project in Visual studio

I am running a Selenium C# project through Visual studio and suddenly encountered an error

Access to the path 'c:\users\documents\visual studio 2017\Project\SeleniumTestProject\SeleniumTestProject\bin\Debug\chromedriver.exe' is denied.

I removed the readonly attribute for the folder but still get this error. Can anyone please suggest me what could be wrong and solution for the same.

like image 496
Vivek Rao Avatar asked May 22 '17 03:05

Vivek Rao


People also ask

How do I remove Chromedriver exe?

First end the process of chromedriver.exe from Task Manger, then Delete the chromedriver.exe from your project bin file and check whether Selenium. WebDriver. ChromeDriver package installed or not, If it's not installed you should installSelenium.

How do I remove Chromedriver exe from Eclipse?

To do that, you need to click on Task Manager (Cntrl+Alt+Del) -> Select Task Manager and search for all Chorme Driver(s) and delete these tasks from process on Task Manager.

Where is Chromedriver exe in Selenium?

Below are the steps to follow while configuring the chrome setup for Selenium. #1) Check the version of the chrome. #3) Download the chromedriver.exe file for the respective OS and copy that .exe file into your local. #4) The path of the chromedriver (C:\webdriver\chromedriver.exe) will be used in our program.


Video Answer


2 Answers

Just worked when I killed the chrome driver exe from command prompt

  • Launch command prompt and enter "taskkill /f /im chromedriver.exe"

  • Clean your solution

like image 133
Gobena Avatar answered Oct 24 '22 04:10

Gobena


I solved it by shutting down the ChromeDriver correctly. I used: IWebDriver.Dispose() for quitting the ChromeDriver process

In your case, after your test completes, there should be a chromedriver.exe in your Task Manager which does not quit until you manually "End Process" it. However, if you use IWebDriver.Dispose(), it kills the process. And now, since the chromedriver.exe is no longer in use, the "Access denied" problem also goes away.

Hope this solves your problem. Reference: https://stackoverflow.com/a/44126143/1785144

like image 13
Aniket Deshpande Avatar answered Oct 24 '22 03:10

Aniket Deshpande