As We all know that using selenium, we cannot automate
desktop-based application.
But that's not 100% true😊, Because using selenium we can automate desktop application which
is build in electron and nodeJS.
Now what is electron?
Electron is a framework for creating native applications
with web technologies like JavaScript, HTML, and CSS. It takes care of the hard
parts, so you can focus on the core of your application.
Now a day’s there are many good companies using electron for
there product few of them are
·
Slack,
·
WordPress desktop app
·
Visual Studio
Code (VS Code)
·
Skype
And there many more. electron application basically looks like below image in which we can have developer tool to inspect elements.For developer tool you need to press ctl+alt+i it open just like chrome browser but still your not able to open developer tool then need to ask your deployment team to enable developer tool from there code its self.
If you want to automate such type of applications using selenium
java then you simply must follow following steps.
System.setProperty("webdriver.chrome.driver",
"path of the exe file\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
/* setting electron binary path */
options.setBinary("C:\Users2\ElectronAPIDemos.exe");
ChromeDriverService chromeservices = new
ChromeDriverService.Builder().build();
driver = new ChromeDriver(chromeservices, options);
That's it and it will launch your desktop application and rest of
things that will work as normal selenium.
Thanks, For any query mail me on qaautomation365@gmail.com or you can add comments below.
Comments
Hoi An Basket Boat Tour| Phong Nha Pioneer Travel| Central Vietnam Package Tour| Viet Tours| My Son Tours| Hoi An Eco Tour| Tour Service Provider1| Tour Service Provider2| Tour Service Provider3| Tour Service Provider4| Tour Service Provider5| Tour Service Provider6| Tour Service Provider7| Tour Service Provider8| Tour Service Provider9| Tour Service Provider10| Tour Service Provider11| Tour Service Provider12| Tour Service Provider13| Tour Service Provider14| Tour Service Provider15| Tour Service Provider16| Tour Service Provider17| Tour Service Provider18| Tour Service Provider19| Tour Service Provider20
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally.
(unknown error: DevToolsActivePort file doesn't exist)
"
Could you please let us know if any solutions?
you need to check with your DEV team and ask them to activate the DEV tool
We need Selenium online courses