title: Testing Electron app using selenium, java in MacOS environment
body: <p>Is there sample java code for launching electron apps using selenium-chromedriver?  Here's where I am at this point.  My code brings up the electron app, and I can view the webElements on that page, but doesn't launch the app I need to test.  I can drag the app over to the electron window and it launches, but the WebDriver doesn't point to it.</p>
  
  <pre><code>private void electronTest() throws Exception {
  
      //select electron-chromedriver
      System.setProperty("webdriver.chrome.driver", "/Users/username/work/node_modules/electron-chromedriver/bin/chromedriver");
  
      ChromeOptions options = new ChromeOptions();
      // path for Electron
      options.setBinary("/Users/username/work/app/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron");
      // I have tried both the folder and the app
      options.addArguments("/Users/username/work/app/out/packages/mac/electronApplication.app");
  
      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setCapability("chromeOptions", options);
      capabilities.setBrowserName("chrome");
  
      driver = new ChromeDriver(capabilities);
      // have also tried...
      //driver = new RemoteWebDriver(new URL("http://localhost:9515"), capabilities);
  
      // Electron page appears, but doesn't launch the Electron app
  
      // driver is pointing to the electron page elements even if I drag the app to launch it
      String screenText = " [" + driver.findElement(By.tagName("BODY")).getText().replace("\n", "][") + "]";
      System.out.println("screenText " + screenText);
  }
  </code></pre>