如何使用FirefoxProfile在FireFox Selenium webdriver中启用Adobe Flash [英] How to enable Adobe Flash in FireFox Selenium webdriver with FirefoxProfile
本文介绍了如何使用FirefoxProfile在FireFox Selenium webdriver中启用Adobe Flash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一种自动方式在Firefox Selenium webdriver中启用Flash而无需用户交互。
I need an automated way to enable Flash in the Firefox Selenium webdriver without user interaction.
我试过:
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 this still requires me to click "Allow".
推荐答案
我自己找到了解决方案。
I found the solution myself.
此文章演示如何禁用的Adobe Flash Player中Python
要在JAVA中启用它,只需将false更改为true。
And to enable it in "JAVA", Just change the false to true.
profile.setPreference("dom.ipc.plugins.enabled.libflashplayer.so","true");
它有效:)
这篇关于如何使用FirefoxProfile在FireFox Selenium webdriver中启用Adobe Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文