简体   繁体   中英

How to dismiss the download dialog of Firefox using WebDriver

I write code for my app which when I click a button, the download dialog is popped up. But different from all questions on here, I don't want to save file, I just want to dismiss or close this download dialog.

Is there something like this in Firefox Profile just to dismiss the dialog with a specific file:

firefoxProfile.setPreference("browser.helperApps.neverAsk","text/plain");

I know there is "browser.helperApps.neverAsk.saveToDisk". I wonder if there is something like "browser.helperApps.neverAsk" only. Thanks

setPreference("browser.download.manager.showWhenStarting", true);

Refer below:-

http://www.seleniumeasy.com/selenium-tutorials/how-to-download-a-file-with-webdriver

Hope it will help you :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM