1

I try to run electron app using the following code:

@Test
public void testElectron() {
    System.setProperty("webdriver.chrome.driver", chromeDriverPath);
    ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.setBinary(this.electronPath);
    WebDriver driver = new ChromeDriver(chromeOptions);
}

But I get the following error:

Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) on port 37592
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
org.openqa.selenium.SessionNotCreatedException: session not created: This 
version of ChromeDriver only supports Chrome version 87
Current browser version is 80.0.3987.165 with binary path src\main\resources\electron\electronApp.exe

Is there a specific chromedriver the is suitable for electron app (for selenium java)?

Roy
  • 123
  • 2
  • 9

1 Answers1

1

This error message...

Current browser version is 80.0.3987.165 with binary path src\main\resources\electron\electronApp.exe

...implies that the Chrome browser version is 80.0.


Solution

So as a solution you have to download the matching ChromeDriver from ChromeDriver v80.0.3987.106 repository.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • using this chromedriver version solved it, but why do I have to use such an old version of chromedriver? and what do you mean chrome browser version is 80? because this is electron app. Thank you – Roy Dec 21 '20 at 22:13
  • 1
    @Roy Apologies, I hardly ever looked into _electron app_. However the error message was clear and loud that **Chrome v80.0** was in the play so you have to download and use the matching version of **ChromeDriver v80.0**. – undetected Selenium Dec 21 '20 at 22:15
  • 2
    @Roy - What version of Electron are you using? Electron is built on the Chromium rendering engine. If you upgrade Electron to 11.0 5 (or higher), does that help? See the [11.0.5 release notes](https://www.electronjs.org/releases/stable#11.0.5), where it mentions _Updated Chromium to 87.0.4280.88._ – andrewJames Dec 23 '20 at 21:05
  • And then it will be possible to work with chromedriver 87.0.4280.88? – Roy Dec 24 '20 at 09:50
  • @Roy - that is the idea, yes. I present this as a comment, not as an answer, because I do not have any way to test it for myself. So, if you are comfortable upgrading Electron, then I would recommend doing so. But again, let me ask: **_What version of Electron are you using?_** Because if it's already up-to-date, then this approach is not going to help. (But it would be better to upgrade Electron than to downgrade the chromedriver, right?) – andrewJames Dec 24 '20 at 19:07