微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何使用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);

但这仍然需要我点击“允许”.

This is shown all the time, even with the code above

解决方法:

这不适合我:
profile.setPreference( “dom.ipc.plugins.enabled.libflashplayer.so”, “真”);

相反,我用过:
profile.setPreference(“plugin.state.flash”,2);

我认为“2”也会激活插件.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐