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

使用Microsoft Edge Driver自动化时遇SessionNotCreatedException问题求助

Edge Driver自动化SessionNotCreatedException问题排查与解决

错误信息

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
Host info: host: 'YOGESH', ip: '192.168.1.7'
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.7
Driver info: org.openqa.selenium.edge.EdgeDrivertext

控制台错误截图

控制台错误截图

可能原因及解决办法

  • 浏览器与驱动版本不匹配:

    1. 查看Edge浏览器版本:打开Edge→右上角三个点→帮助和反馈→关于Microsoft Edge,获取版本号
    2. 下载对应版本的Edge Driver,确保版本号完全一致(区分32/64位)
    3. 替换项目或系统路径中的旧驱动,保证代码指向正确的驱动文件
  • 驱动路径配置错误:

    1. 将Edge Driver所在路径添加到系统PATH环境变量,重启IDE后重试
    2. 或在代码中直接指定驱动路径,示例:
      System.setProperty("webdriver.edge.driver", "C:\\your-path\\msedgedriver.exe");
      EdgeDriver driver = new EdgeDriver();
      
  • 权限不足:

    1. 以管理员身份运行IDE或终端,避免浏览器启动被权限限制
    2. 临时关闭杀毒软件/防火墙,排除拦截可能
  • Selenium与驱动兼容性问题:

    1. 当前Selenium版本为4.10.0,尝试升级到最新稳定版
    2. 确保驱动版本与Selenium版本适配
  • 进程残留:

    1. 打开任务管理器,结束所有msedge.exe和msedgedriver.exe进程,重新运行脚本

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.14 19:42:04