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

朱尼德·汗(Junaid Khan):

我需要一种自动化的方法来在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);

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

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

朱尼德·汗(Junaid Khan):

我自己找到了解决方案。

这篇文章展示了如何在Python中禁用Adobe Flash Player

并在“ JAVA”中启用它,只需将false更改为true。

profile.setPreference("dom.ipc.plugins.enabled.libflashplayer.so","true");

它有效:)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用CefSharp启用Adobe Flash?

如何在Selenium中启用PhantomJS WebDriver?

如何在Windows的Superbird浏览器中启用Adobe Flash

如何等待Selenium Webdriver中启用的输入元素?

如何在 Selenium WebDriver 中启用按钮验证?

如何使用FirefoxProfile或FirefoxOptions通过Selenium设置Firefox浏览器的窗口位置

即使过时了,如何使Firefox运行Adobe Flash?

Firefox的Adobe Flash Player插件

Firefox Flash设置启用/禁用

如何启用从Selenium WebDriver登录的ChromeDriver

我如何安装 adobe flash

Selenium中的Adobe Flash,Chrome 54.0.2840.59-1:“不支持此插件”

如何使用python在Chromedriver 83中启用Flash

有没有办法在Adobe Flash和Mozilla Firefox Portable版本中本地包含Adobe Flash?

2016年:替换Adobe Flash的Firefox

如何在Ubuntu 16.04中安装Adobe Flash Player?

如何在Ubuntu中卸载/删除Adobe Flash Player?

在Firefox中使用Adobe Flash Player允许存储的问题

Adobe将停止发布Flash的新版本-Ubuntu中的Flash支持会如何?

如何使用Selenium Webdriver?

使用Selenium和Python禁用Shockwave Flash插件

使用Selenium Webdriver时如何打开普通的chrome或Firefox窗口?

如何使用Java的Selenium webdriver设置Firefox的代理?

如何使用 selenium webdriver Firefox 查找和验证元素“标题”

如何使用 Selenium WebDriver 处理 Firefox 上传文件窗口 - Java

使用Selenium中启用的扩展名启动Firefox

如何为Chromium安装Adobe Flash

如何获取Adobe Flash Player的设置?

Adobe Flash:如何从.txt文件读取多行?