【问题标题】:How to handle downloading popup alert, while downloading a file in chrome如何在 chrome 中下载文件时处理下载弹出警报
【发布时间】:2014-09-05 09:32:23
【问题描述】:

第 1 点。如果我在不加载任何配置文件的情况下启动普通 chrome 驱动程序,那么它将阻止所有 exe(保留/丢弃)

第 2 点。当我提供我的 chrome 配置文件时,以下是我的观察结果:

  1. 清理exe下载正常
  2. 下载错误 exe 会在 chrome 驱动程序上提供与通常在 chrome 浏览器上相同的对话框
  3. 问题在这里:那些正常通过保持/拒绝弹出警报的exe...那些正常在驱动程序上下载的exe。

附上快照 (http://i.stack.imgur.com/PtZ18.png)

我正在通过这种模式加载 chrome 配置文件

ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir="+userProfile);
options.addArguments("--start-maximized");
options.addArguments("test-type");              
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(options);   

所以这是主要问题

还有一件事:实际上这些弹出窗口不是 html 页面。这些都在 chrome 上,所以有什么技术可以使用任何其他免费工具来监视那些?还是硒?

【问题讨论】:

  • 我认为无法在 Chrome 中处理它

标签: selenium selenium-webdriver automation autoit


【解决方案1】:

不妨试试这个

((JavascriptExecutor) driver).executeScript("window.confirm = function(msg) { return true; }");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-11-22
    • 2016-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多