【问题标题】:How to download a file in IE10 using selenium webdriver? [closed]如何使用 selenium webdriver 在 IE10 中下载文件? [关闭]
【发布时间】:2013-10-24 14:14:28
【问题描述】:

我正在尝试使用 selenium webdriver 下载文件,但一旦遇到 IE10 下载对话框,测试就会停止。如何在此对话框中单击保存? Robot API 会有帮助吗?

【问题讨论】:

    标签: java selenium webdriver internet-explorer-10


    【解决方案1】:

    简短回答:This has been asked many times, please search.

    更长更正确的答案:截至目前(2013/10),无法通过 WebDriver 完成。 It's one of the most requested features for the Selenium project.

    您可以尝试以下方法之一:

    1. 使用HttpURLConnectionApache HttpComponents 请求指定链接。您甚至可以通过这种方式下载文件,尽管通常的做法只是断言 200 OK 响应以确保可以下载文件(因为在测试应用程序时通常不需要该文件)。
    2. Snatch the file using any Java approach.this tool 由某人制作,与 Selenium 一起使用。
    3. 使用Robot 类只需按向下箭头Enter 或其他东西。但请注意,这仅适用于您的特定浏览器和操作系统。它很可能会在任何其他配置上中断。

    【讨论】:

      猜你喜欢
      • 2012-06-03
      • 1970-01-01
      • 1970-01-01
      • 2017-08-26
      • 2018-04-14
      • 1970-01-01
      • 2018-04-06
      • 2014-06-24
      相关资源
      最近更新 更多