How to download .docx file using Selenium webdriver in Java?
问题 Can anyone let me know how to download a word file using selenium(java)? My below code is not working. FirefoxProfile prof = new FirefoxProfile(); prof.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/word"); When I click on 'download link or icon' in the page, it prompts a popup to save the download file (see image below) and I need to click on OK button in the popup. Please let me know how to do this using Firefox. 回答1: You need to use ROBOT class for firing an ENTER