在使用 Selenium C# 运行我的自动化测试时,我试图在 InPrivate 模式下启动 IE11。找到了执行此操作的选项,但我似乎无法使用这些代码行。
InternetExplorerOptions options = new InternetExplorerOptions();
options.ForceCreateProcessApi = true;
options.BrowserCommandLineArguments = "-private";
IWebDriver driver = new InternetExplorerDriver(options);
return driver;
驱动程序打开,我可以在任务管理器上看到它,但是 IE 没有打开。如果我在 InternetExplorerDriver 中删除选项,它完全可以正常工作。所以选项有问题。你对此有什么想法吗?
谢谢!