Build/Test Issues

Intermittent Selenium error: DriverServiceNotFoundException

Started by royboy23 on 1,689 views

Hi,

I'm now trying to run some Selenium Tests NCrunch. It works fine if I just run a single test at a time, but when I run several tests, I get an exception for about 50% of my tests:

OpenQA.Selenium.DriverServiceNotFoundException : The file C:\Projects\Zeiterfassung\Zeiterfassung.SeleniumTests\SeleniumDrivers\chromedriver.exe does not exist. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html

I have checked the path just to be sure. There chromedriver.exe is there, which is why the test works fine when running it alone.

The exception seems to occur randomly. The same test might work one time, then fail another. The problem does not occur when using a different test runner, for instance Resharper.

What could be the problem and how can work around it?

Thanks,

Adrian

Edited

Hi Adrian,

This looks to me like it could be a concurrency issue. Probably, your tests (or the selenium infrastructure they're using) are copying or moving this .exe around while they work. This technically means that the tests can't be safely run at the same time on your machine. You might want to look into using some concurrency constraints to stabilise the engine in this scenario, or consider ways to change your tests so that they can run safely concurrently.

If this isn't being caused by concurrency, it's worth looking at the constraints around test atomicity ... there may be sequence dependent behaviour in place, for example, if some of the code is deleting the .exe in certain scenarios.

Edited

Post a reply

Log in to reply.