Selenium: C#. A GetLog(LogType.Browser); throw an error 'object reference not set to an instance of an object'

Created on 30 Dec 2019  ·  4Comments  ·  Source: SeleniumHQ/selenium

🐛 Bug Report

A GetLog(LogType.Browser); throw an error 'object reference not set to an instance of an object'

-->

To Reproduce

ChromeOptions copts = new ChromeOptions();
copts.SetLoggingPreference(LogType.Browser, LogLevel.All);
var service = ChromeDriverService.CreateDefaultService(browserpath);
service.LogPath = browserpath+"chromedriver.log";
service.EnableVerboseLogging = true;
WebDriver = new ChromeDriver(service, copts)

var logEntry = WebDriver.Manage().Logs.GetLog(LogType.Browser);
ChromeDriver version 79.0.3945.3600
Please help

Environment

OS:
Browser:
Browser version:
Browser Driver version:
Language Bindings version:
Selenium Grid version (if applicable):

C-dotnet

Most helpful comment

what version of selenium are you using?

looks like it was resolved in #7390 for alpha-version, but stable is still suffering from this

All 4 comments

what version of selenium are you using?

looks like it was resolved in #7390 for alpha-version, but stable is still suffering from this

I use 3.141.0. But yesterday i used new 4.0.0 alfa 03 version, but i got an
error
' Message:
System.IO.FileNotFoundException : Could not load file or assembly
'WebDriver, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'. The
system cannot find the file specified.
Stack Trace:
PageObject.ctor()
POLogin.ctor()'
I guess it connected with SeleniumExtras.PageObjects

2020 թ. հնվ 9, հնգ, 17:49 cath3r0 notifications@github.com օգտատերը գրել
է՝

what version of selenium are you using?

looks like it was resolved in #7390
https://github.com/SeleniumHQ/selenium/issues/7390 for alpha-version,
but stable is still suffering from this


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/SeleniumHQ/selenium/issues/7900?email_source=notifications&email_token=AHZ7EULBJFNKHH6LMLKCJOTQ44TPNA5CNFSM4KBMK5CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIQLP4Y#issuecomment-572569587,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHZ7EUMJFYKIOYTMO6RPFT3Q44TPNANCNFSM4KBMK5CA
.

I've upgraded Selenium Webdriver/Support version to 4.0.0-alpha04, but now there are new errors

Severity Code Description Project File Line Suppression State
Error CS0012 The type 'ISearchContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'WebDriver, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'. PageObjects ...PageObjectsPageObject.cs 20 N/A

Severity Code Description Project File Line Suppression State
Error CS0012 The type 'IWebDriver' is defined in an assembly that is not referenced. You must add a reference to assembly 'WebDriver, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'. PageObjects ...PageObjectsPageObject.cs 20 N/A

Severity Code Description Project File Line Suppression State
Error CS1503 Argument 2: cannot convert from 'PageObjects.PageObject' to 'SeleniumExtras.PageObjects.IElementLocator' PageObjects ...PageObjectsPageObject.cs 20 N/A

Severity Code Description Project File Line Suppression State
Error CS0012 The type 'IWebDriver' is defined in an assembly that is not referenced. You must add a reference to assembly 'WebDriver, Version=3.10.0.0, Culture=neutral, PublicKeyToken=null'. PageObjects ...PageObjectsPageObject.cs 101 N/A

Any updates on this?

Was this page helpful?
0 / 5 - 0 ratings