Option to replace file with same name on download

151 views
Skip to first unread message

Gavin AutoTester

unread,
Mar 21, 2016, 10:50:34 PM3/21/16
to Selenium Users
Is there a way to have the browser automatically replace a file with the same name if it exists?

Example:
1. Test downloads file called sample.csv 
2. Re-run test
3. Test downloads file called sample(1).csv

Is there a way(a preference) so that when downloading the file it will just replace sample.csv instead of downloading a new file?

I have the usual preference set up for file downloads
fxProfile.setPreference("browser.download.folderList",2);
    fxProfile.setPreference("browser.download.dir","c:\\mydownloads");
    fxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");

Mark Collin

unread,
Mar 22, 2016, 4:00:10 AM3/22/16
to Selenium Users
If you did that how would you know that a new file had downloaded, and that you aren't checking the existing file?

Have a read of this:

Reply all
Reply to author
Forward
0 new messages