指定 IE 驱动程序的日志路径

本文关键字:日志 路径 驱动程序 IE 指定 | 更新日期: 2023-09-27 18:36:54

我正在尝试为此指定IE驱动程序日志路径,我使用了命令行代码,如下所示

var optionsIe32 = new InternetExplorerOptions
                {
                    IntroduceInstabilityByIgnoringProtectedModeSettings = true,
                    EnsureCleanSession = true,
                    BrowserCommandLineArguments = "--log-file='"C:''IE.log'"
                };
var _webDriver = new InternetExplorerDriver(pathContainingIE32DriverServer, optionsIe32);

但是,发生错误时,日志文件不会更新。

我在这里做错了什么?提前致谢

指定 IE 驱动程序的日志路径

你大部分时间都在那里。它在 InternetExplorerService 类中指定:

var service = InternetExplorerDriverService.CreateDefaultService();
service.LogFile = "C:'IE.log";
service.LoggingLevel = InternetExplorerDriverLogLevel.Trace;

LoggingLevel修改为您实际想要的,您应该会看到可能性是DebugErrorWarnInfoFatalTrace。我相信Trace级别的日志记录是最全面的。

optionsIe32上取下BrowserCommandLineArguments,然后像往常一样将InternetExplorerService传递到Driver结构中,以及您已经做出的选项:

var driver = new InternetExplorerDriver(service, optionsIe32);