Cannot load extension using firefox driver selenium when using AddExtension [duplicate]

≡放荡痞女 提交于 2020-06-01 05:57:05

问题


I created a new firefox profile via selenium geckodriver, and I am trying to add a new extension to this profile via the in built method AddExtension("xpi path"). I have no run-time errors, however when the browser opens, it's like no extensions were installed. In fact when I check the add-on tab, there are no add-ons/extensions.

private void btnCreate_Click(object sender, EventArgs e) {

    var profile = new FirefoxProfile();
    profile.AddExtension( @ "C:\Users\danza\AppData\Roaming\Mozilla\Firefox\Profiles\vdxp2a78.kelley\extensions\hotspot-shield@anchorfree.com.xpi");
    var firefoxOptions = new FirefoxOptions { Profile = profile };
    var firefoxDriver = new FirefoxDriver(firefoxOptions);

    firefoxDriver.Navigate().GoToUrl("http://www.google.com");
}

The below image is the add-on tab with the above code, proving that no addon was actually added.

来源:https://stackoverflow.com/questions/57778036/cannot-load-extension-using-firefox-driver-selenium-when-using-addextension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!