OpenQA.Selenium.Firefox,想要安装Firfefox Extension XPI,什么也没有发生

时间:2019-01-13 13:24:21

标签: c# .net selenium-webdriver geckodriver

我要安装的XPI路径是

#region VARS
const string adblock = @"C:\pm\Sources\Extension\adblock_plus-3.4.2-an+fx.xpi";

然后我执行以下操作,firefox中什么也没有发生,没有加载/安装扩展名。

const string adblock = @"C:\pm\Sources\Extension\adblock_plus-3.4.2-an+fx.xpi";
FirefoxProfile profile = new FirefoxProfile();
profile.AddExtension(adblock);
FirefoxOptions ffoptions = new FirefoxOptions(); 
IWebDriver driver = new FirefoxDriver(ffoptions);

不接受:无法从FirefoxProfile转换为FirefoxOptions:

const string adblock = @"C:\pm\Sources\Extension\adblock_plus-3.4.2-an+fx.xpi";
FirefoxProfile profile = new FirefoxProfile();
profile.AddExtension(adblock);
IWebDriver driver = new FirefoxDriver(profile);

0 个答案:

没有答案