0

I was looking for the option to enable flash and other internal plugin to be enabled using chrome option so that my web automation passes without any human operation.

For Firefox it is working as,

profile = webdriver.FirefoxProfile()
profile.set_preference('plugin.state.flash', 2)

but I want to do using chrome and all integrated plugin and flash should be enabled by default. Need help regarding this.

Using python.

Dhiraj Jha
  • 21
  • 5
  • Your answer could be here - https://sqa.stackexchange.com/questions/30312/enable-flash-player-on-chrome-62-while-running-selenium-test – NarendraR May 10 '18 at 09:12
  • I had checked that earlier, I am looking for the way using python as I am new to both python and selenium. – Dhiraj Jha May 10 '18 at 09:55
  • @DebanjanB, No, it's not. I am looking for the flag which I can set using python. – Dhiraj Jha May 10 '18 at 11:06
  • @DhirajJha Do you mean you need the Pythonic version? – undetected Selenium May 10 '18 at 12:10
  • Yes @DebanjanB. I am looking for the pythonic version. I got this but I am not sure how to do it by python. ChromeOptions options = new ChromeOptions(); Map 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); options.setExperimentalOption("prefs", prefs); ChromeDriver driver = new ChromeDriver(options); – Dhiraj Jha May 10 '18 at 12:59
  • Thanks @demouser123 it worked for me. – Dhiraj Jha May 21 '18 at 17:14

0 Answers0