I am using Selenium Web Driver API with Java. Every time I want to debug my test cases, a temporary profile for Firefox is created in the temporary files directory. This is a headache in two ways.
- It definitely is taking unnecessary time to create a profile and is taking unnecessary space.
- I cannot install any addons that will be available next time I launch my test cases.
How do I get around this?
You can control how the Firefox driver chooses the profile. Set the
webdriver.firefox.profileproperty to the name of the profile you want to use. Most folks think this is a bad idea, because you’ll inherit all the cookies, cache contents, etc. of the previous uses of the profile, but it’s allowed if you really want to do it.For example:
UPDATE – From Ranhiru
How I handled it for Java
Then I changed settings in Firefox to clear all cookies and cache when exiting. Look here on how to do it.