Selenium does not delete profiles when closing the browser

I run fairly simple tests using browser and selenium to open Firefox browsers and navigate random pages. Each instance of firefox must be independent, and none of them use cookies or cache. On my mac osx machine, this works very well. Browsers open, move across multiple pages, and then close. However, on my Windows computer, even after closing the firefox browser, the tmp * * folders are saved, and after the test continues, for some time they begin to take up a lot of space. I got the impression that each newly created browser will have its own profile, which it clearly does, but that it will delete the profile that it made when the browser was closed. Is there an explicit selenium command that I skip to enforce this behavior?

In addition, I noticed that some of the tmp folders appear in AppData / Local / Temp / 2, and many others appear in the folder where I started running the script ...

+4
source share
1 answer

On your Mac, did you browse / var / folders /? You can find several anonymous * webdriver-profile folders several levels down. (mine will appear in / var / folders / sm / jngvd 6s57ldb916b7h25d57r0000dn / T /)

Also, are you using .close () driver or driver.quit ()? I thought driver.quit () cleared the temporary folder, but I could be wrong.

+7
source

All Articles