I am running my selenium test on CentOS for some time now and lately encountered a lot of stability issues and crashes for my test runs. I went on to find that selenium browser profiles created under temp folder were never getting deleted. I manually deleted all temp files and now the system seems stable.

Is there a check I can put in place to handle this and ensure temp files are deleted once the browser instance is terminated by driver.quit()?


I do not think that selenium should be concerned about cleaning temporary files - especially files which might be needed for post-mortem analysis.

Much simpler solution is to have a cron job deleting profiles which are too old.

Edit: Another option would be to FTFM for the driver in question and find out if quit() is supposed to delete temp files. If it is, and is not doing it, there might be already a bug filed for it, or needs to be filed. I do not see this as an important problem and would assume fixing this would be a low priority tho.

|improve this answer|||||
  • When I run the same script on windows, the driver.quit() method deletes the temp files associated with the driver instance. I have created a cron job to delete profiles in temp folder every day. However, I was looking for a permanent solution using the code itself as the code may be moved to a different system in future – BountyHunter Sep 21 '16 at 6:16
  • what driver.quit() docs says about temp files removal? – Peter M. - stands for Monica Sep 21 '16 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.