StdOut 充斥着 'C:\fakepath' 警告整数除法可能要慢得多,如果可能,请尝试使用 uints 通过 C# 使用 Selenium

StdOut is spammed with 'C:\fakepath' warnings integer divides may be much slower, try using uints if possible using Selenium through C#

我正在使用 Selenium Firefox Web 驱动程序。它工作正常,但是当我使用命令行 "dotnet run" 时,命令行上出现了一些我没有解决的警告日志。我该如何解决这个问题?

var options = new FirefoxOptions();
            options.AddArguments("--headless");
            IWebDriver driver = new FirefoxDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options);
            var link = "ANY LINK";

            driver.Navigate().GoToUrl(link);
            driver.FindElement(By.ClassName("ANY CLASS NAME")).Click(); 
            driver.Dispose();

由于图像损坏,这里有一些警告 link

1578640820834   addons.webextension.screenshots@mozilla.org     WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1578640820834   addons.webextension.screenshots@mozilla.org     WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1578640820834   addons.webextension.screenshots@mozilla.org     WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1578640820834   addons.webextension.screenshots@mozilla.org     WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
WARN: compileToBinary(259):
C:\fakepath(337,18-133): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(343,62-116): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(360,75-84): warning X3556: integer divides may be much slower, try using uints if possible.
C:\fakepath(363,50-59): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(383,33-90): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(174,1-6): warning X4000: use of potentially uninitialized variable (dyn_index_vec4_float4)
C:\fakepath(289,25-29): error X4576: Input array signature parameter  cannot be indexed dynamically.

WARN: compileToBinary(259):
C:\fakepath(337,18-133): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(343,62-116): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(360,75-84): warning X3556: integer divides may be much slower, try using uints if possible.
C:\fakepath(363,50-59): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(383,33-90): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(174,1-6): warning X4000: use of potentially uninitialized variable (dyn_index_vec4_float4)
C:\fakepath(289,25-29): error X4576: Input array signature parameter  cannot be indexed dynamically.

WARN: compileToBinary(259):
C:\fakepath(360,75-84): warning X3556: integer divides may be much slower, try using uints if possible.
C:\fakepath(363,50-59): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(174,1-6): warning X4000: use of potentially uninitialized variable (dyn_index_vec4_float4)
C:\fakepath(225,1): warning X4000: use of potentially uninitialized variable (f_distance_aa)
C:\fakepath(262,1): warning X4000: use of potentially uninitialized variable (f_do_clip)

[Child 7840, Chrome_ChildThread] WARNING: pipe error: 109: file z:/task_1572401533/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 341
[Ch1578640823372        Marionette      INFO    Listening on port 58853
1578640829566   Marionette      INFO    Stopped listening on port 58853
[Parent 18380, Gecko_IOThread] WARNING: pipe error: 109: file z:/task_1572401533/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 341
[Child 23108, Chrome_ChildThread] WARNING: pipe error: 109: file z:/task_1572401533/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 341
[GPU
###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

这些警告消息...

WARN: compileToBinary(259):
C:\fakepath(337,18-133): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(343,62-116): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(360,75-84): warning X3556: integer divides may be much slower, try using uints if possible.
C:\fakepath(363,50-59): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(383,33-90): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(174,1-6): warning X4000: use of potentially uninitialized variable (dyn_index_vec4_float4)
C:\fakepath(289,25-29): error X4576: Input array signature parameter  cannot be indexed dynamically.
.
WARN: compileToBinary(259):
C:\fakepath(360,75-84): warning X3556: integer divides may be much slower, try using uints if possible.
C:\fakepath(363,50-59): warning X3556: integer modulus may be much slower, try using uints if possible.
C:\fakepath(174,1-6): warning X4000: use of potentially uninitialized variable (dyn_index_vec4_float4)
C:\fakepath(225,1): warning X4000: use of potentially uninitialized variable (f_distance_aa)
C:\fakepath(262,1): warning X4000: use of potentially uninitialized variable (f_do_clip)

...是 StdOutWebrender 启用时被 C:\fakepath 垃圾邮件的结果。


分析

在启用 WebRender 的情况下打开 Firefox 时,如果 stdout 被捕获,则会观察到这些 warning 消息。这些 warning 消息是 shaderGPU -> ANGLE 模块中的 WebRender 更改的结果。

我们在以下主题中详细分析和讨论了这个问题:

最后通过这个merge / commit

解决了这个问题

解决方案

确保:

  • JDK 升级到最近的水平 JDK 8u222
  • Selenium 升级到当前级别 Version 3.141.59
  • GeckoDriver 升级到 GeckoDriver v0.26.0 级别。
  • GeckoDriver 出现在所需位置。
  • GeckoDriver 拥有非 root 用户的可执行权限。
  • Firefox 版本升级到 Firefox v70.0 级别。
  • 清理你的项目工作区通过你的IDE重建你的项目只需要依赖。
  • (WindowsOS only) 使用 CCleaner 工具清除执行 OS 之前和之后的所有琐事 测试套件.
  • (LinuxOS only) Free Up and Release the Unused/Cached Memory in Ubuntu/Linux Mint 在你的测试套件执行之前和之后。
  • 如果您的基础 Web 客户端 版本太旧,则通过 Revo Uninstaller 卸载它并安装最新的 GA 和发布版本的 Web 客户端.
  • 系统重启
  • 以非 root 用户身份执行 Test
  • 始终在 tearDown(){} 方法中调用 driver.quit() 以优雅地关闭和销毁 WebDriverWeb Client 实例.