简体   繁体   中英

Can't add selenium ide extension to webdriver

Any suggestion why the code below is not adding an extension?

FirefoxProfile profile1 = new FirefoxProfile();
profile1.AddExtension(@"C:\\Downloads\\selenium-ide-2.5.0.xpi");
IWebDriver driver1 = new FirefoxDriver(profile1);

The same code is working fine with firebug add-on. I think there is compatibilty error with the latest firefox. I also tried to install 2.0.0 version of selenium IDE but it didnt help.

It might be help....

 File file = new File("firebug-1.8.1.xpi");
 FirefoxProfile firefoxProfile = new FirefoxProfile();
 firefoxProfile.addExtension(file);
 firefoxProfile.setPreference("extensions.firebug.currentVersion", "1.8.1"); // Avoid             startup screen
 WebDriver driver = new FirefoxDriver(firefoxProfile);

Answer was found:

  1. Open selenium ide extension as archive (using winrar/winzip/etc)
  2. Extract selenium-ide.xpi
  3. Add selenium-ide.xpi via addExtension

Result: It works!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM