You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Selenium+GeckoDriver遇“Unable to read VR Path Registry from”错误求助

Fixing "Unable to read VR Path Registry from" Error in Selenium Java with Firefox

Environment Info

  • Version: geckodriver-v0.20.0-win64
  • OS: Windows 10 Home Single
  • Browser: Firefox 59.0.2 (64-bit)
  • Selenium Version: selenium-java-3.11.0
  • IDE: IntelliJ Idea 2018.1 Community Edition

What's Causing This Error?

First off, don’t panic too much—this is mostly a warning message rather than a critical failure that stops your WebDriver scripts from running. It pops up because geckodriver is trying to access VR (Virtual Reality) related registry settings on your Windows system that either don’t exist, are misconfigured, or aren’t supported by your older Firefox/geckodriver versions.

Step-by-Step Solutions

Let’s go through the fixes from easiest to more advanced:

1. Update Your Geckodriver & Firefox to Compatible Versions

Your current versions are pretty outdated (they date back to 2018), and older releases often have compatibility quirks like this warning.

  • Grab the latest stable geckodriver for Windows 64-bit (make sure it matches your Firefox version—compatibility details are listed in geckodriver’s release notes).
  • Upgrade Firefox to a newer maintained version (Firefox 115+ is a solid LTS choice, since older versions no longer receive updates).
  • Double-check that geckodriver is still properly added to your Windows system PATH after updating.

2. Disable VR Features via FirefoxOptions

If you don’t need VR support at all, you can explicitly turn it off in your code to suppress the warning. Add these lines when initializing your FirefoxDriver:

import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;

public class YourTestClass {
    public static void main(String[] args) {
        FirefoxOptions options = new FirefoxOptions();
        // Disable VR features to skip the registry check
        options.addArguments("--disable-features=Vr");
        
        WebDriver driver = new FirefoxDriver(options);
        // Rest of your test code here...
    }
}

3. Manually Fix the VR Registry Entry (Advanced)

If you’re comfortable editing the Windows Registry, you can create the missing VR path entry geckodriver is looking for:

  1. Press Win + R, type regedit, and hit Enter to open the Registry Editor.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenVR\Paths
  3. If this path doesn’t exist, right-click on Khronos, select New > Key, name it OpenVR, then right-click OpenVR and create another Key named Paths.
  4. Close the Registry Editor and restart your IDE/test script.

Quick Note

If the warning doesn’t actually block your scripts from running, you can choose to ignore it—it’s just geckodriver logging a minor missing configuration, not a showstopper. But if you want clean log output, the fixes above should take care of it.

内容的提问来源于stack exchange,提问作者Lolaika BadtzMaru

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:30:12