Electron application support

63 views
Skip to first unread message

Aleksandra Tsinina

unread,
Oct 13, 2023, 6:14:06 AM10/13/23
to selenide
Hello,
Currently I'm looking for library that I could use for testing of an Electron application.
I found one topic in your group added on May the 5th 2021 and you recommended to try an older ChromeDriver(83).
As two years already passed, I would like to ask if it's already possible to use a newer one?
Also, what settings I should use except of the specific browser version and the application binary path to get at least my first login test working? 
Is the url address mandatory in this case?

I have already experience with Selenide but this time I should do everything from scratch for an Electron app.
Here is the example the previous topic originator provided, not sure how much up-to-date this is with latest Selenide version:

 System.setProperty("webdriver.chrome.driver", "D:\\temp\\chromedriver.exe");
        Configuration.browser = "chrome";
        baseUrl = "http://localhost:4201";
        ChromeOptions options = new ChromeOptions();
        options.setBinary("C:\\AFC\\myelectronapp.exe");
        options.addArguments("--window-size=400,300");
        options.addArguments("--disable-infobars");
        options.addArguments("--no-sandbox");  
        options.addArguments("--disable-gpu");
        options.setCapability("chromeOptions", options);
        WebDriver driver = new ChromeDriver(options);
        WebDriverRunner.setWebDriver(driver);
        Selenide.open(baseUrl);


Thank you for support,
Sandra

Andrei Solntsev

unread,
Oct 14, 2023, 3:42:01 AM10/14/23
to Aleksandra Tsinina, selenide
Hi Sandra.
Unfortunately, I don't know the answer to your question. 

Yes, I know that Selenide was used for testing Electron applications. And yes, that time you had to use the older ChromeDriver 83.
But I don't know if something has changed in this area since then. :(

Andrei Solntsev


пт, 13 окт. 2023 г. в 13:14, Aleksandra Tsinina <aleksandr...@vixtechnology.com>:
This email is confidential. If you have received this email in error please notify us immediately by return email and delete this email and any attachments. Vix accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.

--
You received this message because you are subscribed to the Google Groups "selenide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenide+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenide/db20128e-8804-40a1-a725-3a3597c21db1n%40googlegroups.com.

Mira

unread,
Oct 15, 2023, 11:10:24 PM10/15/23
to Andrei Solntsev, Aleksandra Tsinina, selenide
We also use old version of chrome driver, I don't think that the new one is working (at least not with our Electron app). Example of our code:
  // you need to unpack chromedriver 2.42.591088 from https://chromedriver.storage.googleapis.com/2.42/chromedriver_win32.zip and provide path to it below
System.setProperty("webdriver.chrome.driver", "C:\\Custom Chrome Driver\\chromedriver_win32\\chromedriver.exe");

Configuration.browser = "chrome";
baseUrl = "http://localhost:9222";
options = new ChromeOptions();
// Electron app must be installed
options.setBinary("C:\\AppPath\\ElectronApp.exe");

options.addArguments("start-maximized"); // https://stackoverflow.com/a/26283818/1689770
options.addArguments("enable-automation"); // https://stackoverflow.com/a/43840128/1689770
// options.addArguments("--headless"); // only if you are ACTUALLY running headless
options.addArguments("--no-sandbox"); //https://stackoverflow.com/a/50725918/1689770
options.addArguments("--disable-infobars"); //https://stackoverflow.com/a/43840128/1689770
options.addArguments("--disable-dev-shm-usage"); //https://stackoverflow.com/a/50725918/1689770
options.addArguments("--disable-browser-side-navigation"); //https://stackoverflow.com/a/49123152/1689770
options.addArguments("--disable-gpu"); //https://stackoverflow.com/questions/51959986/how-to-solve-selenium-chromedriver-timed-out-receiving-message-from-renderer-exc
options.addArguments("--remote-debugging-port=9222"); //9222
options.addArguments("--disable-setuid-sandbox");

Aleksandra Tsinina

unread,
Oct 18, 2023, 7:48:20 AM10/18/23
to selenide
Hi Andrei, Mira,
Thank you for quick answers.

I have tried to use the settings Mira shared and at least I was able to run the Electron application.
Session seemed be opened but it couldn't find any element on the UI.
I received the following exception print out:

org.openqa.selenium.NoSuchWindowException: no such window: target window already closed
from unknown error: web view not found
  (Session info: chrome=110.0.5481.104)
Build info: version: '4.11.0', revision: '040bc5406b'
System info: os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.8.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [33ef0b901c0948e31e81465268b7db24, findElement {using=xpath, value=.//*/text()[normalize-space(translate(string(.), '

 ', '    ')) = "Next"]/parent::*}]

Also it reported a warning regarding missing selenium devtools maven import:

WARNING: Unable to find CDP implementation matching 110
okt 18, 2023 12:39:00 PM org.openqa.selenium.chromium.ChromiumDriver lambda$new$5
WARNING: Unable to find version of CDP to use for 110.0.5481.104. You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.11.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.

Could you please share your thoughts if you know how could I try to solve those things?
Should I add a maven import for a specific selenium devtools version and where I could find the appropriate version number?

Best regards,
Sandra

Reply all
Reply to author
Forward
0 new messages