Forum Discussion
Adding Chome Extension to Edge 85 with Selenium Java
- Sep 22, 2020
thanks for tagging me, Deleted .
farisk2010 , I think you just have they syntax incorrect for enabling extensions via the current driver design:
var options = new EdgeOptions();
options.AddArguments("load-extension=/path/to/extension");so something like this:
public static WebDriver ini() {
System.setProperty("webdriver.edge.driver", "D:\\SeleniumTest\\new\\msedgedriver.exe");
DesiredCapabilities desiredCapabilities = new DesiredCapabilities ();
EdgeOptions options = new EdgeOptions();
//ArrayList<String> extensionList=new ArrayList<String>();
String extensionLocation="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\85.0.564.51\\Extensions\\CombinedExtension";
//extensionList.add(extensionLocation);options.setCapability( "disable-infobars", true);
options.setCapability("extensionPaths", extensionList);
options.AddArguments("load-extension=" + extensionLocation);options.merge(desiredCapabilities);
WebDriver driver = new EdgeDriver(options);
return driver;
}
farisk2010 Thanks for letting us know, and welcome to the MSFT Edge Insider community!
I believe johnjansen has done related webdriver work and might be able to help.
Fawkes (they/them)
Program Manager & Community Manager - Microsoft Edge
thanks for tagging me, Deleted .
farisk2010 , I think you just have they syntax incorrect for enabling extensions via the current driver design:
var options = new EdgeOptions();
options.AddArguments("load-extension=/path/to/extension");
so something like this:
public static WebDriver ini() {
System.setProperty("webdriver.edge.driver", "D:\\SeleniumTest\\new\\msedgedriver.exe");
DesiredCapabilities desiredCapabilities = new DesiredCapabilities ();
EdgeOptions options = new EdgeOptions();
//ArrayList<String> extensionList=new ArrayList<String>();
String extensionLocation="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\85.0.564.51\\Extensions\\CombinedExtension";
//extensionList.add(extensionLocation);
options.setCapability( "disable-infobars", true);
options.setCapability("extensionPaths", extensionList);
options.AddArguments("load-extension=" + extensionLocation);
options.merge(desiredCapabilities);
WebDriver driver = new EdgeDriver(options);
return driver;
}
- farisk2010Sep 23, 2020Copper Contributor
johnjansen and @fawkes
Thank you for your reply. It worked fine and the extension is getting added
- AnonymousSep 23, 2020
farisk2010 Excellent, we're glad to hear it! Best of luck with the extension.
Fawkes (they/them)
Program Manager & Community Manager - Microsoft Edge