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

添加SikuliX API后Selenium出现SessionNotCreatedException错误求助

问题:添加SikuliX API依赖后Selenium无法启动新会话

环境信息

  • Eclipse IDE
  • selenium-java v4.8.3
  • SikuliX API v2.0.5

错误信息

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.

已排查操作

  • 确认Edge浏览器与Edge WebDriver版本兼容
  • 检查msedgedriver.exe文件路径无误
  • 尝试切换使用ChromeDriver,并且重启过电脑,但错误仍然存在

相关代码

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.sikuli.script.Screen;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;

public class HandlingUploadDownloadFiles {

    public static void main(String[] args) throws FindFailed {
        
        System.setProperty("webdriver.edge.driver", "D:\\Programming-Tools\\Eclipse IDE\\WebDriver\\Edge\\edgedriver_win64\\msedgedriver.exe");
        
        WebDriver driver = new EdgeDriver(); // 实例化驱动对象
        driver.get("https://www.ilovepdf.com/pdf_to_word"); // 打开链接
        driver.manage().window().maximize(); // 最大化窗口
        
        driver.findElement(By.xpath("//a[@id='pickfiles']")).click();
        
        String filePath = "D:\\Projects\\Test Automation\\AutomationPractice\\AutomationPractice\\files\\";
        
        Screen screen = new Screen();
        
        Pattern inputTextField = new Pattern(filePath+"InputTextField.png");
        Pattern openButton = new Pattern(filePath+"OpenButton.png");
        
        screen.wait(inputTextField, 10);
        screen.type(inputTextField, filePath+"SampleFile.pdf");
        screen.click(openButton);
    }
}

错误截图

错误截图

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.25 13:47:51