Webdriver设置Firefox自动下载

时间:2014-06-10 20:43:42   收藏:0   阅读:414
看到很多人在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);

 

Webdriver设置Firefox自动下载,布布扣,bubuko.com

原文:http://www.cnblogs.com/zhangfei/p/3779518.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!