简体   繁体   中英

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:

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.

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
  • Selenium : 3.14.0
  • ChromeDriver : 2.43
  • Chrome : 69.0

Analysis & Solution


Reference

You can find a related discussion in Automation Testing Error : org.openqa.selenium.WebDriverException: disconnected: unable to connect to renderer


tl;dr

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 .

Try using JDK 1.8.0_181. I had the same issue after updating to JDK 1.8.0_191.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM