user6541331
user6541331

Reputation:

How to enable flash in Selenium python firefox

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")

Upvotes: 4

Views: 1722

Answers (1)

nettux
nettux

Reputation: 5406

Try adding the following to your current code:

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

Upvotes: 5

Related Questions