Yes it is possilbe to change the download folder. You have to specify that in the FirefoxProfile before you initialize the Firefox Driver:
FirefoxOptions options = new FirefoxOptions();
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("browser.download.dir","your folder");
options.setProfile(profile);
FirefoxDriver driver = new FirefoxDriver(options);
I actually haven't had to change the download path of Firefox Driver so far, but if I run into a similar problem while testing, your solution will certainly help me! Thanks for sharing!
I would also add a note that if you change default download directory manually through browser setting, it will not be same when selenium scripts launch a browser. Selenium launch browser with default settings.
Comments