0

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.

enter image description here

Danny
  • 425
  • 7
  • 19
  • No, these are not duplicates for my problem... – Danny Sep 04 '19 at 04:33
  • Did you ever figure this out? I created a bug report here: https://github.com/SeleniumHQ/selenium/issues/8285 – slhck May 17 '20 at 12:29
  • Yes I remember I had to write an extension method to reload the extensions in browser: Message me for the code since someone closed my question, or else if you want to take a different approach check my following blog: https://programmingtuts101.blogspot.com/2019/09/5-easy-steps-to-test-browser-extensions.html – Danny May 26 '20 at 21:37
  • In fact I found an answer here: https://stackoverflow.com/questions/61851866/selenium-does-not-install-add-on-in-firefox-when-using-the-addextensions-option – slhck May 27 '20 at 19:08

0 Answers0