Selenium WebDriver can’t start

After a few days of writing tests using Selenium, the WebDriver suddenly stopped working. It did not even start. I tried to restart my machine, check versions of Firefox and Selenium (both were up to date), restart Visual Studio, clean solution. Nothing worked.  There was not even an exception description. All I got was a message “Exception does not have a stack trace”. Not very helpful.

After some time I found the cause of this: When Selenium WebDriver starts it creates its own copy of  Firefox profile in Temp folder. If WebDriver is stopped in a standard way, then it cleans up after itself and deletes the folder (In my case it has about 33MB). But if it is only terminated, then the folder remains there. And because I am using RAMDisk and my Temp folder is mapped there, I’ve run out of memory after a few days. Surprisingly everything else worked fine, maybe a little slower. But WebDriver just silently died. After I’ve clean up my Temp folder it started to work again. Hope this helps someone.