0

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: error message is displayed while running parallel execution after configuring --remote-debugging-port=9222 chrome option. How to fix this issue ?

Note : (unknown error: DevToolsActivePort file doesn't exist) error message is displayed if it is not configured --remote-debugging-port=9222 chrome option, so I have added remote debugging port in chrome options

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setPageLoadStrategy(PageLoadStrategy.NONE);
chromeOptions.addArguments("--no-sandbox"); 
chromeOptions.addArguments("--start-maximized"); 
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-infobars");
chromeOptions.addArguments("--disable-dev-shm-usage"); 
chromeOptions.addArguments("--disable-browser-side-navigation"); 
chromeOptions.addArguments("--disable-gpu"); 
chromeOptions.addArguments("--disable-notifications");
chromeOptions.addArguments("--remote-debugging-port=9222");
chromeOptions.addArguments("--disable-extensions");
chromeOptions.setExperimentalOption("useAutomationExtension", false);
chromeOptions.addArguments("allow-running-insecure-content");
chromeOptions.addArguments("--ignore-certificate-errors");  
driver = new ChromeDriver(chromeOptions);

Error message :

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed.
     (The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
    System info: host: 'fffffff', ip: 'xyz', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_231'
    Driver info: driver.version: ChromeDriver
    remote stacktrace: Backtrace:
            Ordinal0 [0x00B30C83+1707139]
            Ordinal0 [0x00A968F1+1075441]
            Ordinal0 [0x00A0DFC9+516041]
            Ordinal0 [0x0099D373+54131]
            Ordinal0 [0x009BBFD7+180183]
            Ordinal0 [0x009BBDDD+179677]
            Ordinal0 [0x009B9D4B+171339]
            Ordinal0 [0x009A1D4A+73034]
            Ordinal0 [0x009A2DC0+77248]
            Ordinal0 [0x009A2D59+77145]
            Ordinal0 [0x00AABB67+1162087]
            GetHandleVerifier [0x00BCA966+508998]
            GetHandleVerifier [0x00BCA6A4+508292]
            GetHandleVerifier [0x00BDF7B7+594583]
            GetHandleVerifier [0x00BCB1D6+511158]
            Ordinal0 [0x00AA402C+1130540]
            Ordinal0 [0x00AAD4CB+1168587]
            Ordinal0 [0x00AAD633+1168947]
            Ordinal0 [0x00AC5B35+1268533]
            BaseThreadInitThunk [0x770362C4+36]
            RtlSubscribeWnfStateChangeNotification [0x77411E39+1081]
            RtlSubscribeWnfStateChangeNotification [0x77411E04+1028]
poovaraj
  • 609
  • 1
  • 6
  • 10
  • 1
    Does this answer your question? [WebDriverError: disconnected: unable to connect to renderer](https://stackoverflow.com/questions/46807596/webdrivererror-disconnected-unable-to-connect-to-renderer) – demouser123 Apr 19 '20 at 06:43
  • @demouser123 I have fixed rendered issue and it's showing different issue – poovaraj Apr 19 '20 at 06:52

1 Answers1

0
--remote-debugging-port=9222 

this option is used when you are trying to run your tests on chrome browser which is already running on this port 9222

and same is error message which says chrome.exe is not running

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed. (The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

So see your test case what it is doing, I believe you are trying to capture already running chrome node registered with grid.

so this might also required

cp.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");

Full working example here

  1. start chrome browser using command C:\Program Files (x86)\Google\Chrome\Application>chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\autoprofile"

  2. The code to connect the browser is :- package com.example; import org.openqa.selenium.By; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions;

    public class ChromeDebugger {
        public static void main(String[] args) throws InterruptedException {
        ChromeOptions cp = new ChromeOptions();
        cp.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
        System.setProperty("webdriver.chrome.driver",
                "./src/test/resources/drivers/chromedriver.exe");
        ChromeDriver driver = new ChromeDriver(cp);
        System.out.println(driver.getTitle());
        driver.findElement(By.linkText("About")).click();
        System.out.println(driver.getTitle());
          }    
    

    }

Amit Jain
  • 4,389
  • 2
  • 18
  • 21