我曾尝试通过硒启动Firefox浏览器,但不幸的是,浏览器启动后立即关闭。我无法从日志文件解释。
以下是日志文件条目:
1582121786461 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.d4XupquDfaWC"
1582121787117 [email protected] WARN Loading extension '[email protected]': Reading manifest: Invalid extension permission: mozillaAddons
1582121787117 [email protected] WARN Loading extension '[email protected]': Reading manifest: Invalid extension permission: telemetry
1582121787118 [email protected] WARN Loading extension '[email protected]': Reading manifest: Invalid extension permission: resource://pdf.js/
1582121787118 [email protected] WARN Loading extension '[email protected]': Reading manifest: Invalid extension permission: about:reader*
JavaScript error: resource:///modules/sessionstore/SessionStore.jsm, line 1325: uncaught exception: 2147746065
1582121789421 Marionette INFO Listening on port 33105
1582121789488 Marionette WARN TLS certificate errors will be ignored for this session
19:46:29.537 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
19:46:29.559 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 1420379c-5cc3-444a-8309-0492333a3c5f (org.openqa.selenium.firefox.GeckoDriverService)
1582121794637 Marionette WARN TimedPromise timed out after 5000 ms: stacktrace:
bail@chrome://marionette/content/sync.js:237:64
Fatal: no entropy gathering module detected
Redirecting call to abort() to mozalloc_abort
###!!! [Parent][MessageChannel] Error: (msgtype=0x1E008F,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv
A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
JavaScript error: resource:///modules/sessionstore/SessionFile.jsm, line 376: Error: _initWorker called too early! Please read the session file from disk first.
[Parent 423702, Gecko_IOThread] WARNING: pipe error (82): Connection reset by peer: file /home/abuild/rpmbuild/BUILD/firefox-68.2.0/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358
1582121795636 Marionette INFO Stopped listening on port 33105
以下是浏览器/库的版本:
我尝试了不同版本的Gecko驱动程序和Selenium,但是没有任何效果。请让我知道对此的任何解决方案。
此错误消息...
Fatal: no entropy gathering module detected
Redirecting call to abort() to mozalloc_abort
.
A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
JavaScript error: resource:///modules/sessionstore/SessionFile.jsm, line 376:
Error: _initWorker called too early! Please read the session file from disk first.
[Parent 423702, Gecko_IOThread] WARNING: pipe error (82): Connection reset by peer: file /home/abuild/rpmbuild/BUILD/firefox-68.2.0/ipc/chromium/src/chrome/common/ipc_channel_posix.cc
...表示内容处理在创建会话时崩溃,并且出现内核恐慌。
有关您的代码试用和Trace级别日志的更多信息,将有助于我们以更好的方式分析问题。但是,4.9.x kernels早已观察到此问题。有时还会发现此问题,并损坏了urandom / random
但是,看来您的主要问题是正在使用的二进制版本之间的incompatibility,如下所示:
根据Supported platforms中的文档,在Firefoxen部分提到的二进制文件之间似乎有些不匹配:
在Firefox 57及更高版本中,支持是最好的,尽管通常Firefox版本越新,它们的错误修复和功能越多,体验就越好。某些功能仅在最新的Firefox版本中可用,我们强烈建议将最新的Firefox Nightly与geckodriver一起使用。由于Firefox 53不再支持Firefox中的Windows XP,因此我们不支持该平台。
Note:从0.26.0版本开始,geckodriver可以连接到Android设备,并控制基于GeckoView的程序包(例如Firefox Preview aka Fenix或Firefox Reality)。但是它仍然仍然支持Fennec最高68 ESR的版本,这是Mozilla的最后一个官方支持的版本
。解决方案
确保:
Test
。>>driver.quit()
方法中调用tearDown(){}
以正常关闭并销毁WebDriver根据使用GeckoDriver