如何阻止硒chromedriver登录到屏幕 [英] how to stop selenium chromedriver from logging to the screen
问题描述
如何阻止Selenium chromedriver将错误记录到屏幕上?
How do I stop selenium chromedriver from logging errors to the screen?
我正在进行一些黄瓜测试,而我正在使用水豚&硒铬驱动器来驱动测试。
在过去的几周里,IVE注意到Chromedriver已经开始将其错误消息记录到屏幕上。我的测试仍然可以正常运行,但是错误阻塞了输出。
I am running some cucumber tests and Im using capybara & the selenium chromedriver to drive the tests. In the last few weeks ive noticed that the Chromedriver has started logging its error messages to the screen. My tests still run fine but the errors are clogging up the output.
下面是输出:
Started ChromeDriver
port=9515
version=23.0.1240.0
log=C:\Gitrepos\Base Tests\chromedriver.log
[8244:5080:1115/151428:ERROR:gpu_info_collector_win.cc(91)] Can't retrieve a valid WinSAT assessment.
Given I Select "Customer" from the "Search" gadget
And I enter "Test Customer" for "Customer Name"
And click "Search"
And Select "Manage Customer" from the "Main Menu" drop down
解决方案是从输出中删除以下行或可能修复错误。
[8244:5080:1115/151428:ERROR:gpu_info_collector_win.cc(91)]无法检索有效的WinSAT
评估。
The solution would be to remove the following line from the output or possibly to fix the error. [8244:5080:1115/151428:ERROR:gpu_info_collector_win.cc(91)] Can't retrieve a valid WinSAT assessment.
我已升级驱动程序以解决其他错误,但最终却收到此错误!
I upgraded the driver to fix a different error but I ended up getting this error!
推荐答案
尝试使用STDERR重定向启动Chromedriver,例如
Try to start the Chromedriver using a redirect of STDERR, e.g.
chromedriver.exe 2> c:\temp\err.log
chromedriver.exe 2>c:\temp\err.log
这篇关于如何阻止硒chromedriver登录到屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!