Lol*_*aru 7 java selenium intellij-idea selenium-webdriver geckodriver
您好,我开始在intelliJ IDEA中使用带有Java的WebDriver.我使用Maven导入了Selenium,并使用Selenium网页中提供的代码添加了依赖项.我下载了geckodriver并更新了Windows路径.我开始编码,但我得到的输出在我看来是一个错误.有人可以帮我理解发生了什么吗?
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class firstTry {
public static void main (String [] args){
WebDriver driver = new FirefoxDriver();
driver.quit();
}
}
Run Code Online (Sandbox Code Playgroud)
Firefox打开和关闭没有问题,但在控制台中我有一个输出似乎是一个错误给我.如下:
1522649487586 geckodriver INFO geckodriver 0.20.0
1522649487598 geckodriver INFO Listening on 127.0.0.1:31435
1522649488194 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\Lolaika\\AppData\\Local\\Temp\\rust_mozprofile.0neo1vgzqEe7"
Unable to read VR Path Registry from C:\Users\Lolaika\AppData\Local\openvr\openvrpaths.vrpath
1522649490188 Marionette INFO Enabled via --marionette
Unable to read VR Path Registry from C:\Users\Lolaika\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\Lolaika\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\Lolaika\AppData\Local\openvr\openvrpaths.vrpath
1522649494926 Marionette INFO Listening on port 54726
1522649495670 Marionette WARN TLS certificate errors will be ignored for this session
abr 02, 2018 1:11:35 A.M. org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMACIÓN: Detected dialect: W3C
1522649495872 addons.xpi WARN Exception running bootstrap method shutdown on activity-stream@mozilla.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIObserverService.removeObserver]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://activity-stream/lib/SnippetsFeed.jsm :: uninit :: line 125" data: no] Stack trace: uninit()@resource://activity-stream/lib/SnippetsFeed.jsm:125 < onAction()@resource://activity-stream/lib/SnippetsFeed.jsm:141 < _middleware/</<()@resource://activity-stream/lib/Store.jsm:51 < Store/this[method]()@resource://activity-stream/lib/Store.jsm:30 < uninit()@resource://activity-stream/lib/Store.jsm:153 < uninit()@resource://activity-stream/lib/ActivityStream.jsm:274 < uninit()@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Program%20Files/Mozilla%20Firefox/browser/features/activity-stream@mozilla.org.xpi!/bootstrap.js:80 < shutdown()@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Program%20Files/Mozilla%20Firefox/browser/features/activity-stream@mozilla.org.xpi!/bootstrap.js:196 < callBootstrapMethod()@resource://gre/modules/addons/XPIProvider.jsm:4419 < observe()@resource://gre/modules/addons/XPIProvider.jsm:2279 < GeckoDriver.prototype.quit()@driver.js:3270 < despatch()@server.js:557 < execute()@server.js:531 < onPacket/<()@server.js:506 < onPacket()@server.js:505 < _onJSONObjectReady/<()@transport.js:500
[Child 2272, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 2272, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/cUnable to read VR Path Registry from C:\Users\Lolaika\AppData\Local\openvr\openvrpaths.vrpath
Promise rejected while context is inactive: Message manager disconnected
[Parent 5308, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 5336, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 5336, Chrome_ChildThread] WARNIN[Parent 5308, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 8788, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 8788, Chrome_ChildThread] WARNING: pipe error: 109*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping
[GPU 10500, Chrome_ChildThread] WARN
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
1522649503244 geckodriver::marionette ERROR Failed to stop browser process
Process finished with exit code 0
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能解决这个问题?
使用GeckoDriver v0.20.0和Firefox Quantum v59.0.2(64 位),您的代码块看起来不错,并且日志堆栈跟踪看起来同样足够好,没有日志消息:
Promise rejected while context is inactive: Message manager disconnected
Run Code Online (Sandbox Code Playgroud)
根据Mozilla 支持论坛中的讨论,此错误似乎是Privacy Badger。简而言之,此问题是由未加载/正常工作的扩展引起的。
@Test.未解决的承诺是否在 window.unload 事件之前被拒绝?
好吧,正如我在我的回答中提到的,根据当前的实现,您的堆栈跟踪足够公平。但就我个人而言,我在本地主机上没有看到此痕迹:
Promise rejected while context is inactive: Message manager disconnected
Run Code Online (Sandbox Code Playgroud)
一些粗略的痕迹可能取决于底层操作系统。现在进行整个讨论未解决的承诺是否在 window.unload 事件之前被拒绝?底线似乎是:
卸载页面(或者通常在卸载页面中的脚本调用)的承诺没有被很好地指定并且没有被互操作性地实现的问题是非常真实的。另请参阅https://bugzilla.mozilla.org/show_bug.cgi?id=1058695,我们最终在 Gecko 中加入了一些技术上不符合规范的缓解措施,因为从技术上讲,遵循规范需要在常见情况下泄露世界.... 问题是,目前还没有针对此事件循环内容的规范,而 Promise 的规范是 ES6 的一部分,ES6 并没有真正承认 Realms 在某种意义上需要消失的可能性,所以没有什么可以提出这样的问题。
因此结论是你很擅长领先
| 归档时间: |
|
| 查看次数: |
3015 次 |
| 最近记录: |