-1

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:

enter image description here

How can i fixed this error ?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Amir
  • 81
  • 1
  • 12
  • Please read why [a screenshot of code is a bad idea](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors). Paste the code and properly format it instead. – JeffC Oct 20 '18 at 15:47
  • Did you google the error message? What did you find? What did you try based on what you found? Do a little searching and update your question with the results. – JeffC Oct 20 '18 at 15:47
  • Possible duplicate of [WebDriverError: disconnected: unable to connect to renderer](https://stackoverflow.com/questions/46807596/webdrivererror-disconnected-unable-to-connect-to-renderer) – Navarasu Oct 20 '18 at 23:06

2 Answers2

1

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 i.e. 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.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
0

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

double-beep
  • 5,031
  • 17
  • 33
  • 41
abr
  • 180
  • 1
  • 3