Webdriver设置Firefox自动下载
时间:2014-06-10 20:43:25
收藏:0
阅读:286
看到很多人在firefox上操作下载窗口用autoit,太麻烦了,提供一种用profile来解决的办法:
FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.downloadDir", "c:\\data"); profile.setPreference("browser.download.folderList", 2); profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream, application/vnd.ms-excel, text/csv, application/zip"); driver = new FirefoxDriver(profile);
评论(0)