我需要一种自动方式在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”也会激活插件.
原文地址:https://codeday.me/bug/20190608/1197259.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。