t3sk0
t3sk0

Reputation: 33

Unable to run sequential Selenium tests in Visual Studio 2013due to VS holding a lock on ChromeDriver

I've been fighting with intermittent bouts of the following error when trying to run a small suite of selenium tests in Visual Studio 2013 Ultimate (on a windows 10 machine authored in C#.)

Warning 1 Could not copy "C:\Users\t3sk0\Documents\Visual Studio 2013\Projects\UnitTestProject1\UnitTestProject1\Dependencies\chromedriver.exe" to "bin\Release\Dependencies\chromedriver.exe". Beginning retry 1 in 1000ms. The process cannot access the file 'bin\Release\Dependencies\chromedriver.exe' because it is being used by another process. UnitTestProject1

Doing a quick google and StackOverflow search brought me to a known issue that's seemed to have been in existence since 2010-ish with no tangible resolution. Just a handful of odd workarounds from the community. The issue happens more than it doesn't.

Does anyone know of an actual solution to this? It's really slowing me down and it's driving me crazy! Thanks!

Upvotes: 1

Views: 3498

Answers (1)

parishodak
parishodak

Reputation: 4666

Error says:

The process cannot access the file 'bin\Release\Dependencies\chromedriver.exe' because it is being used by another process

Go to task manager kill all the chromedriver process left hanging, or just restart the machine and run the test again.

To avoid this error, use driver.quit() at the end of the test.

Example: http://www.mkyong.com/selenium/many-chromedriver-exe-are-left-hanging-on-windows-selenium/

Upvotes: 4

Related Questions