4

When I open firefox it has Flash installed in it but when I open it through selenium That version of firefox has not Flash in it. How to enable flash in selenium . This is the test code I am working with :

firefoxProfile = FirefoxProfile()
firefoxProfile.set_preference('dom.ipc.plugins.enabled.libflashplayer.so','true')
b = webdriver.Firefox(firefoxProfile, executable_path=r"C:\\Program Files\geckodriver-v0.16.1-win64\geckodriver.exe")
b.get("http://www.python.org")
2
  • There are two ways to do that, 1. Create a profile manually with flash add-on like Adobe, etc. Then load it with selenium driver. 2. Download flash plugin installer and add while launch the browser. Commented Jun 10, 2017 at 17:13
  • 1
    @Murthi Thankyou for the help I tired first one and googled a lot. I am able to open firefox with flash. but it is disabled. How can I Activate in code. So that firefox lunch with Flash with status "Always activate" Commented Jun 10, 2017 at 18:25

1 Answer 1

5

Try adding the following to your current code:

firefoxProfile.set_preference("plugin.state.flash", 2)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.