【发布时间】:2019-10-28 02:41:11
【问题描述】:
我尝试通过路径字符串加载配置文件,但它不起作用。
FirefoxOptions options = new FirefoxOptions();
options.Profile = new FirefoxProfile(@"d:\firefox");
options.Profile.SetPreference("privacy.trackingprotection.enabled", true);
IWebDriver driver = new FirefoxDriver(options);
如果添加参数,它可以工作但不能自动化。
options.AddArguments("-profile", @"d:\firefox");
【问题讨论】:
-
@DebanjanB 您的 Java 解决方案,我的 C# 问题。我按文件夹路径加载配置文件,而不是按名称加载配置文件。谢谢
-
添加了相关的 C# 目标
-
@DebanjanB driver = new FirefoxDriver(profile);老了
标签: c# selenium selenium-firefoxdriver