【问题标题】:How to automate downloading "txt.htm.xls" file format using Selenium Webdriver?如何使用 Selenium Webdriver 自动下载“txt.htm.xls”文件格式?
【发布时间】:2017-10-23 13:28:13
【问题描述】:

我有一个应用程序,用户单击图标并下载文件。文件的扩展名是:

txt.htm.xls

我已设置偏好:

             profile.setPreference("browser.helperApps.neverAsk.saveToDisk", 
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;");

但这不起作用,因为MIME 类型似乎不正确。

【问题讨论】:

标签: java selenium firefox selenium-webdriver


【解决方案1】:
profile.setPreference("browser.helperApps.neverAsk.saveToDisk", 
        "text/plain,text/html, application/xml");

这应该可以解决您的问题

【讨论】:

  • 没有。我无法使用上面的代码解决问题。
猜你喜欢
  • 2012-06-03
  • 2013-09-16
  • 2017-08-26
  • 2018-04-14
  • 1970-01-01
  • 2016-08-12
  • 2014-03-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多