How to enable Adobe Flash in FireFox Selenium webdriver with FirefoxProfile
I need an automated way to enable Flash in Firefox Selenium web browser without user interaction.
I tried:
FirefoxProfile profile = new FirefoxProfile();
//As 0 is to disable, I used 1. I don"t know what to use.
profile.setPreference("plugin.state.flash", 1);
WebDriver driver = new FirefoxDriver(profile);
But it still requires me to click "Allow".
+3
source to share
2 answers
I found a solution myself.
This post shows how to disable Adobe Flash Player in Python
And to enable it in "JAVA" just change false to true.
profile.setPreference("dom.ipc.plugins.enabled.libflashplayer.so","true");
And it works :)
+1
source to share