For a while now we’ve been executing a set of automated tests based on WebDriver 2.25.0 using the FirefoxDriver. The tests are executed in parallel (2 threads per core on a quad-core machine) by a Maven 3.0-based build and its FailSafe plugin. Every test has a @BeforeClass method that retrieves an instance of the FirefoxDriver and clears all cookies. All this is working fine.
Because of changes to proxy authentication (there was none before), we now need to run the tests using a particular Firefox profile. The profile was created, and the build now includes the -Dwebdriver.firefox.profile= environment variable. The profile seems to be picked up since we’re not getting any “profile not found” error. However, it seems that every Firefox instance is using the same copy of the profile and therefore is sharing the same cookie store: the application should be offering a region selection dialog on a user’s first visit but doesn’t when running those tests.
Update: The behaviour is the same when running without the -Dwebdriver.firefox.profile variable and using new FirefoxDriver(new ProfilesIni().getProfile(“<profileName>”)) .
Isn’t the FirefoxDriver creating a copy of the specified profile and running each Firefox instance using that isolated copy?
Thanks!
FirefoxDriver, then when you run the code :new FirefoxDriver(...), an anonymus profile is created insideC:\Users\#TheUser\AppData\Local\Tempfolder , named e.g.anonymous1864251113973276405webdriver-profile.FirefoxDriver, then the behavior is the same, excepting the fact that profiles copies are named : e.g.userprofile6938771758695790613copy.In conclusion, Webdriver always creates a copy of a profile within this
Tempfolder even you specify or not a custom profile which has to be used. Regarding cookies, every created profile has a file namedcookies.sqliteinside. I’m not 100% sure if cookies interfere in a way or another, they should not. You can check by comparing cookies saved in every webdriver, using: