小编Jun*_*han的帖子

如何使用FirefoxProfile在FireFox Selenium Webdriver中启用Adobe Flash

我需要一种自动化的方法来在Firefox Selenium Webdriver中启用Flash,而无需用户交互。

我试过了:

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);
Run Code Online (Sandbox Code Playgroud)

但这仍然需要我单击“允许”。

即使上面的代码也一直显示

java selenium webdriver selenium-firefoxdriver firefox-driver

5
推荐指数
2
解决办法
4438
查看次数