How can I use Selenium with Java with a custom Firefox Profile?
I have spent a day trying to do this and decided to share it here. There is some information on the web as well but most of them are a bit complicated or not up to date...
Here is my configuration: Firefox version: 12 Selenium version: 2.25 Language: Java Computer: Macintosh
FirefoxBinary binary = new FirefoxBinary(); File firefoxProfileFolder = new File("/Users/xxx/work/xxx/selenium/src/test/resources/firefoxprofile"); FirefoxProfile profile = new FirefoxProfile(firefoxProfileFolder); profile.setAcceptUntrustedCertificates(true); webDriver = new FirefoxDriver(binary, profile);
Again here change the absolute path as required. Add add-ons like autoAuth to pass the HTML Authorization windows in Firefox to this profile..