Webdriver设置Firefox自动下载

看到很多人在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

Webdriver设置Firefox自动下载

上一篇:Android实现3D旋转的View


下一篇:MVC.NET:提供对字体文件.woff的访问