Look at FirefoxProfile:442
File profileDir = TemporaryFilesystem.getDefaultTmpFS()
.createTempDir("anonymous", "webdriver-profile");
copyModel(model, profileDir);
The TemporaryFilesystem
takes it's location from "java.io.tmpdir"
:, which usually points to system's temp directory. Santoshsarma's solution will work because of this line (but it will also move your OS temp directory).
private static File sysTemp = new File(System.getProperty("java.io.tmpdir"));
We can do more! Look at the public method setTemporaryDirectory
!
You can invoke this method just before instantiating your FirefoxDriver
and it should create it's profile copy at the location you specified.