org.openqa.selenium.SessionNotCreatedException:未创建会话:此版本的ChromeDriver仅支持使用Selenium的Chrome版本75 [英] org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 75 using Selenium

查看:222
本文介绍了org.openqa.selenium.SessionNotCreatedException:未创建会话:此版本的ChromeDriver仅支持使用Selenium的Chrome版本75的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打开显示错误的Chrome浏览器.

I want to open the Chrome browser it displays error.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Homepage {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        //Create Driver object
        System.setProperty("webdriver.chrome.driver", "C:\\Workdirectory\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
    }
}

在这里,我期待的是我的Chrome浏览器,但它会抛出类似

Here I am expecting My Chrome Browser but it throws an error like

Starting ChromeDriver 75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770@{#40}) on port 21714
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 75
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'DESKTOP-3JIP3OF', ip: '192.168.1.73', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: driver.version: ChromeDriver

推荐答案

此错误消息...

org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 75

...表示 ChromeDriver v75 仅支持 Chrome浏览器v75 ,这在您的系统中不可用.

...implies that the ChromeDriver v75 supports Chrome Browser v75 only which wasn't available within your system.

您的主要问题是所使用的二进制文件版本之间的不兼容性:

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chromedriver=75.0.3770.8
  • Release Notes of chromedriver=75.0.3770.8 clearly mentions the following :

支持 Chrome 75版

  • 您当前正在使用的最新发布的 Chrome 版本是 chrome = 74.0 .
    • The latest released Chrome version is chrome=74.0 which you are currently using.
    • 因此 ChromeDriver v75.0 Chrome浏览器v74.0

      • Downgrade ChromeDriver to ChromeDriver v74.0 level.
      • Keep Chrome version at Chrome v74.0 level. (as per ChromeDriver v74.0 release notes)
      • Execute your @Test.

      您可以在以下位置找到相关的详细讨论:

      You can find a relevant detailed discussion in:

相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆