我需要一种自动化方法来在 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);
但这仍然需要我点击“允许”。
即使使用上面的代码,它也始终显示 https://i.stack.imgur.com/ARH3D.png
这对我不起作用:profile.setPreference("dom.ipc.plugins.enabled.libflashplayer.so","true");
相反,我使用:profile.setPreference("plugin.state.flash", 2);
我认为“2”也会激活该插件。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)