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

Selenium节点持续离线:桌面-笔记本Grid搭建后节点异常掉线

Troubleshooting Selenium Grid Node Offline Issue After Successful Registration

Hey there, I’ve dealt with this exact problem a few times when setting up Selenium Grid—nodes register successfully but keep dropping offline. Let’s walk through the most likely fixes step by step:

1. Verify Network Connectivity First

This is the #1 culprit for this issue:

  • From your laptop (node machine), ping the Hub’s IP (192.168.0.3). If ping fails, you’ve got a network problem—check if both devices are on the same subnet, or if a firewall is blocking traffic between them.
  • Reverse the test: ping your laptop’s IP from the Hub machine. Bidirectional connectivity is required for the Grid to work properly.
  • Make sure ports 4444 (Hub) and 5566 (node) are open in both devices’ firewalls. For Windows, add inbound/outbound rules for these ports; for Linux, update your iptables or ufw settings.

2. Double-Check the Node Registration URL

Selenium Grid can be picky about URL formatting:

  • Try removing the trailing slash from your registration URL. Instead of http://192.168.0.3:4444/grid/register/, use http://192.168.0.3:4444/grid/register when starting the node.
  • Confirm the Hub is actually running on port 4444: from the Hub machine, open http://localhost:4444/grid/console in a browser. Then try accessing the same URL from your laptop—if it doesn’t load, your network is still blocking the connection.

3. Ensure Matching Selenium Server Versions

Even though you’re using 3.9.1 for both, double-check:

  • Make sure the selenium-server-standalone-3.9.1.jar file is identical on both machines. Sometimes corrupted downloads or mismatched builds can cause silent communication failures. Re-download the jar and replace it on both devices, then restart Hub and node.

4. Dig Into Detailed Logs for Clues

Enable logging to get specific error messages:

  • Start the Hub with logging:
    java -jar selenium-server-standalone-3.9.1.jar -role hub -log hub.log
    
  • Start the node with logging:
    java -jar selenium-server-standalone-3.9.1.jar -role webdriver -hub http://192.168.0.3:4444/grid/register -port 5566 -log node.log
    
  • Check the hub.log and node.log files. Common errors like Connection refused (network block) or Invalid status code 404 (wrong registration URL) will point you straight to the problem.

5. Validate Browser Driver Configuration

A misconfigured browser driver can cause the node to fail silently and go offline:

  • Ensure your laptop has the correct browser driver (e.g., chromedriver for Chrome, geckodriver for Firefox) installed, and that the driver version matches your browser version.
  • Either add the driver’s path to your system’s PATH environment variable, or specify it explicitly when starting the node:
    # Example for Chrome on Windows
    java -Dwebdriver.chrome.driver="C:\drivers\chromedriver.exe" -jar selenium-server-standalone-3.9.1.jar -role webdriver -hub http://192.168.0.3:4444/grid/register -port 5566
    

6. Try a Different Node Port

It’s possible port 5566 is being used by another application on your laptop. Switch to a different port (like 5555) and restart the node:

java -jar selenium-server-standalone-3.9.1.jar -role webdriver -hub http://192.168.0.3:4444/grid/register -port 5555

Start with the network checks—they’re the most common fix here. If that doesn’t work, the logs will give you the exact issue to troubleshoot.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 04:34:39