Selenium 驱动程序问题 - 无法运行脚本

问题描述 投票:0回答:1

提供驱动程序路径后,我无法运行 selenium 脚本。 安装的边缘浏览器版本 - 微软边缘 版本115.0.1901.188(官方版本)(64位)

enter image description here 驱动程序安装到我的 Windows 10 64 位笔记本电脑中 - 产品版本 - 115.0.1901.188 enter image description here

请让我知道为什么我在运行脚本时看到以下异常。 PFA,请参阅下文了解更多详细信息 enter image description here

请帮我解决这个问题。

谢谢, 什雷扬什·辛格

在 Eclipse 中使用 Java 运行我的 selenium 代码时。 下载了边缘浏览器,它出现在脚本中提到的路径下。

selenium-webdriver automated-tests ui-automation selenium-edgedriver edgedriver
1个回答
0
投票

由于您使用的是 Selenium

v4.10.0
,您实际上不需要再设置驱动程序可执行路径。如果您不提供,selenium 的新工具
SeleniumManager
将为您下载/处理驱动程序。

因此删除

System.setProperty
行代码,如下所示:

public static void main(String[] args) {
    // TODO Auto-generated method stub
    WebDriver driver = new EdgeDriver();
    driver.get("https://www.google.com");        
    System.out.println(driver.getTitle());
    driver.close();
}

© www.soinside.com 2019 - 2024. All rights reserved.