我们使用Selenium-WebDriver+ C# +NUnit 框架。最近我们已将 Selenium-WebDriver 4.10 迁移到 4.17。 当我们尝试在 NUnit 框架中执行脚本时,出现以下错误。 我们彻底核实了所有司机、图书馆位置都很好。 我们正在使用 Webdriver-manager。
有人可以帮我解决这个问题吗?
例外:
Message:
System.TypeInitializationException : The type initializer for 'WebDriverManager.Clients.ChromeForTestingClient' threw an exception.
----> System.IO.FileLoadException : Could not load file or assembly 'System.Text.Json, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13aacd2ffd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x90123131)
----> System.IO.FileLoadException : Could not load file or assembly 'System.Text.Json, Version=7.0.0.3, Culture=neutral, PublicKeyToken=cc7b13aacd2ffd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x90123131)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
Stack Trace:
ChromeForTestingClient.GetKnownGoodVersionsWithDownloads()
ChromeConfig.GetVersionFromChromeForTestingApi(String noRevisionVersion)
ChromeConfig.GetMatchingBrowserVersion()
DriverManager.GetVersionToDownload(IDriverConfig config, String version)
DriverManager.SetUpDriver(IDriverConfig config, String version, Architecture architecture)
你能解决这个问题吗?