本文介绍了driver.Manage().Logs.GetLog(LogType.Browser)在Chromedriver版本75.0.3770中不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#.net和Selenium Webdriver(与Chromedriver)一起开发Selenium框架.我最近更新到了最新版本的Chromedriver 75.0.3770.8,现在我的其中一行代码不再起作用:

I am working on a Selenium framework using C# .net and Selenium Webdriver (with Chromedriver).I recently updated to the latest version of Chromedriver 75.0.3770.8 and now one of my lines of code is no longer working:

driver.Manage().Logs.GetLog(LogType.Browser)

我的ChromeOption设置如下:

My ChromeOptions are set as follows:

options.SetLoggingPreference(LogType.Browser, LogLevel.Severe);

所有这些都没有改变-我所做的唯一更新是对Chromedriver75.如果我恢复为Chromedriver 74,则此代码将再次起作用.当前,由于对象引用未设置为对象的实例"而失败.此版本的Chromedriver版本发行说明提到已解决的问题2536:将标准模式(goog:chromeOptions.w3c:true)设置为默认的[Pri​​-2]"和已解决的问题2803:功能名称loggingPrefs不符合规范[Pri- 2]"

None of this has changed - the only update I've made is to Chromedriver 75. If I revert back to Chromedriver 74 then this code works again.Currently it is failing with "object reference not set to an instance of an object".The release notes for this version of Chromedriver mentioned "Resolved issue 2536: Make standards mode (goog:chromeOptions.w3c:true) the default [Pri-2]" and "Resolved issue 2803: Capability name loggingPrefs is not spec compliant [Pri-2]"

除此之外,我看不到任何可能导致此失败的内容.这是不再受支持的东西吗?还是有什么我需要替换我的代码?谢谢

Other than that I can't see anything that could possibly be causing this to fail. Is this something that is no longer supported? Or is there something I need to replace my code with? Thanks

推荐答案

来自SeleniumHQ:

From SeleniumHQ:

在下一个selenium客户端库(和服务器)发行之前,以w3c模式从Chrome获取日志将无法正常工作"

"Getting logs from Chrome in w3c mode is not going to work till the next selenium client libs (and server) release"

这篇关于driver.Manage().Logs.GetLog(LogType.Browser)在Chromedriver版本75.0.3770中不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 16:21