java - 无法读取 VR 路径注册表

标签 java selenium selenium-webdriver intellij-idea geckodriver

  • 版本:geckodriver-v0.20.0-win64
  • 平台:Windows 10 家庭单机版
  • 浏览器:Firefox:59.0.2(64 位)
  • Selenium :selenium-java-3.11.0
  • intelliJ Idea:2018.1 社区版

您好,我开始在 intelliJ IDEA 中将 WebDriver 与 Java 结合使用。我使用 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();
   }
}

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

我该如何修复此输出?

My Workspace

最佳答案

使用GeckoDriver v0.20.0Firefox Quantum v59.0.2(64位),您的代码块看起来不错,并且日志堆栈跟踪看起来同样足够好,没有日志消息:

Promise rejected while context is inactive: Message manager disconnected

根据Mozilla Support Forum中的讨论此错误似乎是Privacy Badger。简而言之,此问题是由未加载/正常工作的扩展引起的。

解决方案

  • JDK 升级到最新级别 JDK 8u162 .
  • Selenium升级到当前级别 Version 3.11.0 .
  • 通过IDE清理您的项目工作区,并仅使用所需的依赖项重建项目。
  • 使用CCleaner工具可以清除执行测试套件之前和之后的所有操作系统杂务。
  • 如果您的 Firefox 基本版本太旧,请通过 Revo Uninstaller 卸载它并安装最新的 GA 和发布版本的 Firefox
  • 重新启动系统
  • 执行您的@Test

tl;博士

Are unresolved promises rejected prior to a window.unload event?

<小时/>

更新

嗯,正如我在我的回答中提到的,根据当前的实现,您的堆栈跟踪是公平的。但就我个人而言,我在我的 localhost 上没有看到此痕迹:

Promise rejected while context is inactive: Message manager disconnected

一些粗略的跟踪可能取决于底层操作系统。现在回顾整个讨论Are unresolved promises rejected prior to a window.unload event?底线似乎是:

The problem of promises from unloading pages (or indeed script invocation in unloaded pages in general) not being specified very well and not being interoperably implemented is very real. See also https://bugzilla.mozilla.org/show_bug.cgi?id=1058695 where we ended up putting in some mitigations in Gecko that technically don't follow the spec, because technically following the spec requires leaking the world in common cases.... The problem is that there is no spec for this event loop stuff right now, and the spec for Promise is part of ES6, which doesn't really doesn't admit the possibility of Realms needing to go away in some sense, so there's nothing to even raise such issues against.

因此结论是你很擅长领先

关于java - 无法读取 VR 路径注册表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51395089/

相关文章:

java - 无法使用 native SQL 查询解析属性 hibernate

java - 使用不正确的包名称编译 .java 文件

python - 使用 Selenium 的 Linkedin Web Scraper

java - 单选按钮的 @FindBy 注释

java - 如何避免 MVEL PropertyAccessExceptions

python - 选择元素不从 .first_selected_option() 方法返回 webelement

linux - 运行 selenium 测试后 Firefox 未关闭

html - 获取表单中的所有元素

python - 使用 Selenium Webdriver 访问在 QT Webkit 之上运行的嵌入式设备 UI

javascript - Java中模板引擎的目的是什么?