使用Selenium WebDriver 3.0.1.0和Marionette以及C#中的geckodriver 0.11.1和Firefox 50。我已经使用FirefoxOptions
作为此ObsoleteAttribute的动机:FirefoxProfile设置被忽略
FirefoxDriver不应该用FirefoxBinary对象构造。 改为使用FirefoxOptions。
的代码是:
FirefoxOptions fo = new FirefoxOptions();
firefoxProfile = new FirefoxProfile();
firefoxProfile.SetPreference("browser.download.folderList", 2);
firefoxProfile.SetPreference("browser.download.dir", DOWNLOAD_FOLDER);
firefoxProfile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv");
firefoxProfile.SetPreference("browser.startup.homepage_override.mstone", "ignore");
firefoxProfile.SetPreference("trustAllSSLCertificates", true);
firefoxProfile.AcceptUntrustedCertificates = true;
fo.Profile = firefoxProfile;
driver = new FirefoxDriver(fo);
在我看来,像在所有未使用指定的firefoxProfile
,SSL证书错误出现,不管被显示在个人资料设置下载中心对话框。我认为它不会因为this bug而忽略SSL证书错误,但它看起来像所有的配置文件设置都被忽略。
如何使配置文件设置生效? (这样就不会出现下载对话框并且SSL错误被忽略)
在切换到Marionette之前,代码工作,看起来像Marionette还没有准备好使用?
我已经切换回IceDragon和硒2.53和一切都工作了。 –