2

I'm try to launch electron application on remote PC which is connected as node to selenium grid.previously its worked fine.But now i'm getting this error "DevToolActivePort file doesn't exist"

    System.out.println("launch application in windows PC");     
    capa  = new DesiredCapabilities();

    capa.setBrowserName("chrome");
    File file = new File("path\\to\\file\\.exe"); 
    URL server = new URL("http://ip_of_remote_pc:4444/wd/hub"); 

    ChromeOptions options = new ChromeOptions();
    options.setBinary(file);   //Sets the path to the Chrome executable
    capa.setCapability(ChromeOptions.CAPABILITY, options);
    driver2 = new RemoteWebDriver(server, capa); //launch the application
    System.out.println("launching application in remote PC");
    driver2.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);   
    System.out.println("Application launched"); 
user8632458
  • 45
  • 1
  • 8
  • Possible duplicate of [org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser](https://stackoverflow.com/questions/50642308/org-openqa-selenium-webdriverexception-unknown-error-devtoolsactiveport-file-d) – undetected Selenium Jun 26 '18 at 07:32
  • I'm tried those solutions,but they didn't help me – user8632458 Jun 27 '18 at 05:33

2 Answers2

6

Download Chrome driver for electron ,,or visit this https://github.com/electron/electron/releases Install the chromedriver here and it will work

4

Just add the following ChromeOptions it will solve the problem,

ChromeOptions options = new ChromeOptions();
options.addArgument("--headless");
options.addArgument("--no-sandbox");  // Bypass OS security model
options.addArguments("--disable-gpu"); // applicable to windows os only
Jai Prak
  • 2,855
  • 4
  • 29
  • 37