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

配置代理的Selenium节点TOML文件无效,JMeter远程测试失败求助

问题根源及修复方案

核心问题分析

1. TOML配置语法错误

你的stereotype字段用双引号包裹JSON字符串,但JSON内部的双引号未做转义,导致TOML解析器无法正确识别配置,Selenium节点无法加载Firefox的驱动配置。

2. Selenium版本不兼容

Selenium节点版本是4.13.0,但JMeter使用的selenium-remote-driver版本是4.8.3,跨大版本的协议差异会导致会话创建超时。

3. Firefox代理配置格式错误

noProxy列表在Firefox中需要用逗号分隔,而非分号(分号是Windows系统的格式)。

4. 弃用参数使用

acceptSslCerts是已弃用的参数,仅保留acceptInsecureCerts即可。


修正后的TOML配置

[node]
detect-drivers = false

[[node.driver-configuration]]
display-name = "firefox"
stereotype = "{\"browserName\": \"firefox\", \"browserVersion\": \"118\", \"platformName\": \"LINUX\", \"acceptInsecureCerts\": true, \"proxy\": {\"httpProxy\": \"http://...:80\", \"proxyType\": \"manual\", \"noProxy\": \"172.*,*.local\"}, \"moz:firefoxOptions\": {\"binary\": \"/usr/local/firefox/firefox-bin\"}}"
log-level = "trace"
webdriver-executable = "/usr/local/bin/geckodriver"
session-timeout = 30

额外排查步骤

  • 升级JMeter的WebDriver插件依赖,确保selenium-remote-driver版本与Selenium节点(4.13.0)一致
  • 验证Geckodriver版本与Firefox 118兼容(建议使用Geckodriver 0.33.0及以上)
  • Linux环境下需确保有可用的显示服务(如Xvfb),否则Firefox无法启动
  • 检查防火墙规则,确保JMeter服务器与Selenium Grid/节点之间的端口通信正常
  • 确认Selenium节点已成功注册到Grid,可通过Grid控制台(默认http://grid-host:4444/ui)查看节点状态

内容的提问来源于stack exchange,提问作者Germano Di Fede

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.09 20:14:48