我收到此错误:
"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/