简体   繁体   English

org.openqa.selenium.SessionNotCreatedException:会话未创建断开连接:无法使用 ChromeDriver 和 Chrome 将消息发送到渲染器错误

[英]org.openqa.selenium.SessionNotCreatedException: session not created disconnected:unable to send message to renderer error with ChromeDriver and Chrome

I try to run this simple program on Java with Selenium:我尝试使用 Selenium 在 Java 上运行这个简单的程序:

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


public class MySelenium {

    public static void main(String[] args) {
        System.out.println("First Selenium");
        System.setProperty("webdriver.chrome.driver", "C:\\automation\\drivers\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.get("https://www.seleniumhq.org/");
        driver.quit();              
    }
}

But on running shows the following error:但是在运行时显示以下错误:

在此处输入图片说明

How can i fixed this error ?我怎样才能修复这个错误?

This error message...这个错误信息...

org.openqa.selenium.SessionNotCreatedException: session not created 
disconnected: unable to send message to renderer

...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser ie Chrome Browser session. ...暗示ChromeDriver无法启动/生成新的WebBrowser,Chrome 浏览器会话。

I suspect your main issue is the incompatibility between the version of the binaries you are using.我怀疑您的主要问题是您使用的二进制文件版本之间的不兼容

As per the snapshot you have provided the following set of binaries you are using looks fine to me:根据您提供的快照,您正在使用的以下二进制文件集对我来说看起来不错:

  • JDK : 1.8.0_191 JDK1.8.0_191
  • Selenium : 3.14.03.14.0
  • ChromeDriver : 2.43 ChromeDriver2.43
  • Chrome : 69.069.0

Analysis & Solution分析与解决方案


Reference参考

You can find a related discussion in Automation Testing Error : org.openqa.selenium.WebDriverException: disconnected: unable to connect to renderer您可以在自动化测试错误中找到相关讨论:org.openqa.selenium.WebDriverException:断开连接:无法连接到渲染器


tl;dr tl;博士

As per ChromeDriver 2.34 doesn't wait until iframe content loads after switching into iframe this issue was also observed with ChromeDriver 2.38 and Chrome 67+ combo and was related to static iframes (part of the originally loaded DOM) which seem to work correctly even till Chrome 66 .根据ChromeDriver 2.34 不会等到 iframe 内容在切换到 iframe 后加载,这个问题也在ChromeDriver 2.38Chrome 67+组合中观察到,并且与静态 iframe (最初加载的 DOM 的一部分)有关,它似乎可以正常工作,直到铬 66

Try using JDK 1.8.0_181.尝试使用 JDK 1.8.0_181。 I had the same issue after updating to JDK 1.8.0_191.更新到 JDK 1.8.0_191 后,我遇到了同样的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.openqa.selenium.SessionNotCreatedException: session not created: 此版本的 ChromeDriver 仅支持使用 Selenium 的 Chrome 75 版 - org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 75 using Selenium org.openqa.selenium.SessionNotCreatedException:会话未为Chrome创建异常 - org.openqa.selenium.SessionNotCreatedException: session not created exception for Chrome Selenium(OSX 和 Linux)抛出错误 org.openqa.selenium.SessionNotCreatedException:会话未创建:找不到匹配的功能 - Selenium(OSX and Linux) thowing error org.openqa.selenium.SessionNotCreatedException: session not created: No matching capabilities found org.openqa.selenium.SessionNotCreatedException:无法通过 Selenium 和 Java 使用 GeckoDriver 和 Firefox 创建会话错误 - org.openqa.selenium.SessionNotCreatedException: Unable to create session error using GeckoDriver and Firefox through Selenium and Java Appium 错误:线程“main”org.openqa.selenium.SessionNotCreatedException 中的异常:无法创建新的远程会话 - Appium Error :Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session org.openqa.selenium.SessionNotCreatedException - org.openqa.selenium.SessionNotCreatedException org.openqa.selenium.SessionNotCreatedException - org.openqa.selenium.SessionNotCreatedException org.openqa.selenium.SessionNotCreatedException:无法创建新会话。 (原始错误:请求了一个新会话,但正在进行中) - org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) Selenium error: “org.openqa.selenium.SessionNotCreatedException: session not created from tab crashed” after update electron engine to 9.0.3 - Selenium error: “org.openqa.selenium.SessionNotCreatedException: session not created from tab crashed” after update electron engine to 9.0.3 org.openqa.selenium.SessionNotCreatedException:消息:无法启动新的 session。响应代码 500 错误使用 Selenium Java - org.openqa.selenium.SessionNotCreatedException: Message: Could not start a new session. Response code 500 error using Selenium Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM