java - Selenium session 未创建异常错误

标签 java eclipse selenium

我收到此错误:

"Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception"

我已将 Chrome 和驱动程序更新到最新版本。但仍然遇到相同的错误。

package helloworld;

public class testfb {
public static void main(String[] args) {
    System.setProperty("webDriver.ChromeDriver", "C:\\minal\\drivers\\ChromeDriver.exe ");
    // TODO Auto-generated method stub
    WebDriver driver = new ChromeDriver();
    driver.get("https://www.google.com/");
    }
}

最佳答案

Chrome 驱动程序系统属性区分大小写。

使用这个:

System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");

关于java - Selenium session 未创建异常错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55934700/

相关文章:

java - 使用 selenium webdriver 2 时 Maven 不会因错误而停止

java - 检测回文

java - 如何在内存中运行编译 kotlin 文件的测试并检查结果?

android - 在 DDMS 下,Google Glass 未显示为 eclipse 上的设备。

java - 为什么Eclipse无法连接到VM? ( socket 关闭)

selenium - 我在哪里可以找到Selenium中与keyPress命令一起使用的数字键代码?

python - 在 VS Code 中使用 Selenium 时无法解析导入 "webdriver_manager.chrome"

java - 使用 Kaitai Struct 在 Java 中解析超过 2.15 GB 的文件

java - 在 TomCat 服务器上使用 JavaServlets 的 Cronjob

java - 在 MAC OS X 上安装 opencv for java 并配置 Eclipse