如何在Chrome 70网络驱动程序上强制启用Flash?不是Chrome 62

时间:2018-11-28 00:28:19

标签: selenium google-chrome

我遇到了使用硒Web驱动程序在Chrome 70上启用闪光灯的问题。每次运行方案时,都会出现安装Flash失败并等待启用的情况。

I've done the below:
A) Coding:
ChromeOptions option = new ChromeOptions();
                option.setExperimentalOption("useAutomationExtension", false);
                option.addArguments("--disable-infobars");
                Map<String, Object> prefs = new HashMap<>();
                // Enable Flash
                prefs.put("profile.default_content_setting_values.plugins", 1);
                prefs.put("profile.content_settings.plugin_whitelist.adobe-flash-player", 1);
                prefs.put("profile.content_settings.exceptions.plugins.*,*.per_resource.adobe-flash-player", 1);
prefs.put("PluginsAllowedForUrls", NeonUtils.getConfigValue("url"));


B) Forcing flash to be enabled on Chrome Web driver, by following below steps:
   1. Input this URL in Chrome: chrome://flags/
   2. On search inbox, search for: ephemeral flash and disable it


Still it re-set the flash enablement next time I run the next scenario.

0 个答案:

没有答案