We recently came across a problem with Selenium not quitting the webdriver and this would then lock a file that was needed on the build server to run the builds. We were using Driver.Quit() but this sometimes failed and would leave chromedriver.exe running. I looked around and found this was a common issue that many people were having. We (I say we, as we came to the solution through paired programming), came up with the following, that would encapsulate the driver.quit inside a task and if this task takes longer than 10 seconds, then it will clean up any processes started by the current process, in the case of the issue on the build server, it would kill any process started by Nunit. [AfterTestRun] public static void AfterTestRun() { var nativeDriverQuit = Task.Factory.StartNew(() => Driver.Quit()); if (!nativeDriverQuit.Wait(TimeSpan.Fr...
Documenting my thoughts on life in the world of Testing