【问题标题】:Adobe Flash in Selenium, Chrome 54.0.2840.59-1: "This plugin is not supported"Selenium 中的 Adob​​e Flash,Chrome 54.0.2840.59-1:“不支持此插件”
【发布时间】:2017-02-27 20:19:04
【问题描述】:

Chrome 54.0.2840.59-1 的最新更新导致 selenium 无法加载 Flash 插件。 chrome://plugins/ 中的 Adob​​e Flash Player 已禁用,但在以前的 Chrome 版本中也已禁用。

这仅发生在 Chromedriver 启动时的测试中,在普通 Chrome 浏览器中导航到 Flash 站点显示没有问题。

【问题讨论】:

    标签: google-chrome flash selenium adobe selenium-chromedriver


    【解决方案1】:

    https://get.adobe.com/flashplayer/ 安装 Flash 播放器适用于我在 mac OS 上,请注意,您需要在 chrome 驱动程序浏览器(而不是系统中的 chrome 浏览器)上安装它。为此,请运行打开 chrome 的 selenium 测试,然后从那里转到该 URL ^ 并按照安装步骤操作。完成后,下次运行测试时,它应该会接受更改并且应该可以工作。

    【讨论】:

      【解决方案2】:

      @sircapsalot:这是可能的,而且我们确实为我们的应用程序实现了自动化,它内置在 Flash 中。它要求我们添加自定义的 flex 处理程序,然后可以通过 javascript 调用。

      Linux:为了让 flash 在 chrome 54 上运行,我从 /usr/google-chrome 中获取了插件文件的工作副本,然后我可以将命令行参数传递给 chromedriver:

      ClassLoader classLoader = getClass().getClassLoader(); File flashPath = new File(classLoader.getResource("libpepflashplayer.so").getFile());

      ChromeOptions options = new ChromeOptions(); options.addArguments("--ppapi-flash-path=" + flashPath);

      return new ChromeDriver(serviceBuilder.build(), options);

      Windows:@user7038292 手动安装 flash 的解决方案解决了这个问题

      【讨论】:

      • 是的,没有使用硒。正如我在答案中指定的那样,它正在使用一个库。
      【解决方案3】:

      Chrome 54 不再支持 Adob​​e Flash Player NPAPI。所以您只需在系统的 chrome 浏览器上安装 Adob​​e Flash Player PPAPI(来自 https://get.adobe.com/flashplayer/)。

      【讨论】:

        【解决方案4】:
        HashMap<String, Object> chromePrefs = new HashMap<>();
        chromePrefs.put("plugins.plugins_enabled", new String[] {
              "Chrome PDF Viewer",
              "Native Client"
              });
        chromePrefs.put("plugins.plugins_disabled", new String[] {
              "Adobe Flash Player"
              });
        ChromeOptions options = new ChromeOptions();
        options.setExperimentalOption("prefs", chromePrefs);
        

        【讨论】:

        • 请在您的代码中添加一些解释。不鼓励仅使用代码的答案。问题出在哪里,您如何通过代码修复它?
        【解决方案5】:

        自 Chrome 53 起,they 拥有 blocked flash 无法在其浏览器上加载。您使用的是 54,所以它适用。

        其次,Selenium 不能自动化 Flash,所以我认为这个问题无论如何都是毫无意义的。如果您需要自动化闪存,您应该考虑使用另一个库。

        【讨论】:

        • 这是适当来源的材料。不知道为什么投反对票。
        • 已经用 Selenium 自动化闪存 4 年了。新的 Chrome 是痛苦的
        【解决方案6】:

        安装 Flash 为我解决了这个问题,我之前使用了 chrome 的胡椒粉,遇到了同样的问题。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2015-09-17
          • 1970-01-01
          • 1970-01-01
          • 2017-10-04
          • 1970-01-01
          • 2020-12-28
          • 1970-01-01
          相关资源
          最近更新 更多