My browser-based application has recently switched over to an electron app and now the tests obviously don't seem to work, they can't pick up the windows and the elements correctly.
I've read that Spectron is used to test electron apps but is it possible to use it with Java and Selenium? I haven't been able to find any examples that aren't in Js. Are there any examples of how electron can be used with java?
Currently, I'm running my electron app like this
public static WebDriver startDriverTwo() {
String projectLocation = System.getProperty("user.dir");
System.setProperty("webdriver.chrome.driver", projectLocation + "/chromedriver.exe");
ChromeOptions opt = new ChromeOptions();
opt.addArguments("start-maximized");
//Enter the path of your Electron app
opt.setBinary("C:/path/to/app.exe");
opt.addArguments("start-maximized");
//opt.addArguments("--headless");
driver = new ChromeDriver(opt);
return driver;
}
And then I get(Url), but this opens 2 windows, and selenium can't seem to recognize them.