I am trying to automate [electron-api-demos][1]app using this sample code.
public static void main(String args[]) throws IOException, InterruptedException
@DebanjanB, Thanks for the help. After I changed the version of the selenium to alpha , I am able to connect to the app with out errors. I am using the following code now :
public static void main(String args[]) throws IOException, InterruptedException {
int port = 9223;
// Open App
Runtime.getRuntime().exec(
"C:\\Program Files\\SampleApp.exe", null,
new File("C:\\Program Files\\SampleApp"));
ChromeOptions options = new ChromeOptions();
String remoteDebuggingAddress = "localhost:" + port;
options.setExperimentalOption("debuggerAddress", remoteDebuggingAddress);
options.addArguments("remote-debugging-port=9223");
options.setBinary(
"C:\\Program Files\\SampleApp.exe");
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\xyz\\eclipse-workspace\\xyz\\src\\demo1\\chromedriver.exe");
WebDriver driver = new ChromeDriver(options);
System.out.println(driver.getTitle());
}
The issue is I am not able to access the elements in chromium at http://localhost:9223/ When I open the chromium or chrome browser at teh local host the following text is displayed . Normally a link is expected . Link or the WebElements are not displayed.
Inspectable WebContents scannerui/appfiles/index.html