【发布时间】:2019-05-27 20:49:02
【问题描述】:
当我开始最小的 Selenium 测试时,我得到了奇怪的日志(不确定它是否是 Gecko 驱动程序的)。如何禁用这些注销如何解决这些问题?
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxDriverLogLevel;
import org.openqa.selenium.firefox.FirefoxOptions;
public class ffruntest {
public static void main(String[] args) {
FirefoxOptions options = new FirefoxOptions();
options.setLogLevel(FirefoxDriverLogLevel.FATAL);
FirefoxDriver driver = new FirefoxDriver(options);
driver.quit();
}
}
日志:
1546245354514 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid host permission: resource://pdf.js/
1546245354514 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid host permission: about:reader*
dec 31, 2018 11:35:57 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[Child 13180, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Child 13180, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Parent 8104, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Child 21768, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[Child 21768, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
[RDD 28500, Chrome_ChildThrJavaScript error: resource://gre/modules/osfile/osfile_async_front.jsm, line 409: Error: OS.File has been shut down. Rejecting post to remove
JavaScript error: resource://gre/modules/osfile/osfile_async_front.jsm, line 409: Error: OS.File has been shut down. Rejecting post to remove
JavaScript error: resource://gre/modules/Sqlite.jsm, line 841: Error: Connection is not open.
JavaScript error: resource://gre/modules/IndexedDB.jsm, line 349: UnknownError: The operation failed for reasons unrelated to the database itself and not covered by any other error code.
Process finished with exit code 0
如您所见,我已经使用了this post 中描述的 FF 选项,它有助于删除一些东西,但不是全部。
- FireFox 65.0b7(64 位),无活动插件,无插件
- geckodriver 0.23.0 (2018-10-04)
- 硒 3.14.0
【问题讨论】:
标签: java selenium selenium-webdriver geckodriver gecko