To enable Flash
before each test and WhiteList
the url you can use the following code block to configure the WebDriver
instance to allow Flash
:
ChromeOptions options = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
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", "https://your_url.com");
options.setExperimentalOption("prefs", prefs);
WebDriver driver = new ChromeDriver(options);
Here you can find a detailed discussion on Manage Flash in Chrome
and on PluginsAllowedForUrls
Update :
You haven’t mentioned in your comment through which client you are not able to find setExperimentalOption
or set_experimental_option
. Here is the snapshot from my IDE which have no errors/warnings :
And here is the JavaDoc :