Selenium WebDriver禁用了我的Firefox插件

本文关键字:我的 Firefox 插件 WebDriver Selenium | 更新日期: 2023-09-27 17:54:35

我在c# winforms应用程序中使用Selenium WebDriver。当我运行应用程序并打开Firefox时,我的插件被禁用了。如何使插件启用?

Selenium WebDriver禁用了我的Firefox插件

您可以显式地将所需的插件设置为ON。例如,如果您想启用firebug,找出插件的zip或xpi的位置,然后使用以下代码:

using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
FirefoxProfile ffprofile = new FirefoxProfile();
ffprofile.AddExtension("C:''firebug.xpi");
ffprofile.SetPreference("extensions.firebug.currentVersion", "1.11.4");
IWebDriver driver = new FirefoxDriver(ffprofile);

我所做的唯一的事情就是通过添加以下的pom.xml,它对我来说工作得很好。目前我在Firefox 43.0.3和Selenium 2.48.2上运行测试。并且在pom.xml中也有Firefox浏览器的依赖项。

org.seleniumhq。Selenium -firefox-driver 2.48.2

在使用这个之后,如果你没有使用你的添加而不是删除消息,我会为你提供一些更多的选项,但希望你能从中得到结果。