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

求助:使用selenium-server-standalone-3.11.0无法打开谷歌网页

Fixing Selenium 3.11.0 "Process unexpectedly closed with status: 0" Error with Firefox

Hey there! Let's tackle this frustrating issue you're hitting. That error message usually points to compatibility mismatches or configuration gaps after your workspace reset—here's how to fix it step by step:

1. Match Firefox, GeckoDriver, and Selenium Versions

Selenium 3.11.0 has strict version compatibility rules:

  • Recommended GeckoDriver version: 0.20.1
  • Compatible Firefox versions: 57.x to 60.x

If your Firefox is newer than 60, it won't play nice with Selenium 3.11.0. To fix this:

  • Download the matching GeckoDriver for your Firefox version
  • Either add it to your system PATH, or explicitly set its path in your code with:
    System.setProperty("webdriver.gecko.driver", "/full/path/to/your/geckodriver");
    

2. Fix Your Code Configuration

Your snippet cuts off, but make sure you're setting the driver property before initializing FirefoxDriver. Here's a complete working example:

package Basic;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class SignIn {
    public static void main(String[] args) {
        // Critical: Set GeckoDriver path first
        System.setProperty("webdriver.gecko.driver", "/path/to/geckodriver");
        
        WebDriver driver = new FirefoxDriver();
        driver.get("https://www.google.com");
        
        // Verify the page loads
        System.out.println("Page Title: " + driver.getTitle());
        
        driver.quit();
    }
}

3. Rule Out Corrupted Firefox Profiles

Sometimes a messed-up Firefox profile causes the driver to crash. Try using a fresh, clean profile:

import org.openqa.selenium.firefox.FirefoxProfile;

// ... inside main method
FirefoxProfile freshProfile = new FirefoxProfile();
WebDriver driver = new FirefoxDriver(freshProfile);

You can also disable Firefox extensions temporarily—some add-ons interfere with Selenium's ability to control the browser.

4. Check Permissions & Executable Access

  • On macOS/Linux: Make sure GeckoDriver has executable permissions. Run this in your terminal:
    chmod +x /path/to/geckodriver
    
  • On Windows: Try running your IDE (like Eclipse/IntelliJ) as Administrator to avoid permission blocks.

5. Clean & Rebuild Your Project

Since you reset your workspace, there might be missing or corrupted dependencies. In your IDE:

  • Go to Project > Clean (Eclipse) or Build > Clean Project (IntelliJ)
  • Rebuild the project to ensure all Selenium libraries are properly included and linked.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.25 08:31:26