Electron APP - Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure

We are using an application with node 18.18.2, electron browser version 28.1.4 and chrome 120.0.6099.216

enter image description here

Trying to launch the app using selenium as coded below.

ChromeOptions opt = new ChromeOptions();
Map<String, Object> cloudOptions;
opt.setPlatformName("Windows 10");
opt.setBrowserVersion("120");
logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
opt.setProxy(startProxyServer());
opt.setCapability("goog:loggingPrefs", logPrefs);
opt.setBinary(new File(Constants.APPPATH));
cloudOptions = new HashMap<>();
opt.setCapability("cloud:options", cloudOptions);
//WebDriverManager.chromedriver().driverVersion("112.0.5615.28").clearDriverCache().setup();
WebDriverManager.chromedriver().driverVersion("120.0.6099.109").clearDriverCache().setup();
System.out.println("Before Driver creation:");

webDriver = new ChromeDriver(opt); 

Getting error:

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. At webDriver = new ChromeDriver(opt);

Please suggest possible fix/solutions for this issue?

Assuming it is a driver compatibility issue we tried with multiple chromedrivers 120.0.6099.28, 120.0.6099.56, 120.0.6099.62, 120.0.6099.71 and 120.0.6099.109 for chrome version 120.0.6099.216. using below code still we are getting the same error.

System.setProperty("webdriver.chrome.driver","C:\\Users\\Path\\chromedriver-win64 (1)\\chromedriver-win64\\chromedriver.exe");

Upvotes: 0

Views: 66

Answers (0)

Related Questions