Automating Electron applications
With version 19.1.19 or later, you can interrogate and create automations with HTML controls in the embedded browser of an Electron application. Use the Universal Web Adapter for Electron applications.
Build 19.1.19 adds the Electron option to the BrowserType property. In addition, you must have Pega Native Foundation version 10.1.4.1903 or later installed for Electron application support. Windows Server 2012 R2 requires Electron 6.0.7 and later.
Use the ElectronConfiguration property section for the Universal Web Adapter to configure the adapter for Electron applications. The section is only accessible if you set the BrowserType property to Electron. This section is collapsible.
Build 19.1.125 adds support for application source code archive (ASAR) files. Ensure that the Electron application loads either an app.asar file or a package.json file that contains the name of the main script that you want to launch. The system does not support launching Electron applications in any other way, such as from the command line.
The ElectronConfiguration section contains the following parameters:
Parameter |
Description |
Path |
The full path to the Electron application executable or the process/script that launches the Electron application executable. |
Folder |
The file folder that is expanded at runtime.
|
ResolvePath |
This boolean parameter determines if the Path property is automatically resolved for you when you enter the executable name. This only happens if the application path is part of the system environmental path. |
Targetpath |
The full path to the Electron application process that gets launched. Use this parameter when the Electron application process is started by a separate process or script defined in the adapter’s Path property. |
WorkingDirectory |
The directory used to launch the Path property. |
There are several ways in which you can start an Electron application using the Universal Web Adapter:
If you want... |
Then... |
The application to start when the adapter starts or interrogation is started. |
Enter the application executable in the Path parameter. Set the Start method to Start. Leave the Target Path parameter blank. |
The application to start and wait. The Path application, batch file, or script is started and the system waits for the executable in Target Path to start before injecting. |
In the Path parameter, enter the path to the executable, script, or batch file that starts the Electron application that you will automate. In the Target Path parameter, enter a value that points to the Electron application executable that you will automate. Set the Start method to Start. |
The system to listen for the application to start and then injects into it. |
Enter the application executable in the Path parameter. Set the Start method to Monitor All. |
To access upload/download/save dialogs opened by the Electron application, or if you need to interrogate non-HTML controls, combine a Windows adapter and the Universal Web Adapter:
1. Create a Windows adapter to start the Electron application. When using Electron 1.7.9, set the HookChildProcesses property to True.
2. Enable Electron interrogation while using a Windows adapter to start it.
a. Set AllowElectron to True in the StudioConfig.xml file.
b. Refresh the Target Factory Configuration cache.
c. Exit Robot Studio.
d. Start the interrogation of the Electron application. Notice that an ElectronTargetFactory control is added.
3. Create a Universal Web Adapter to monitor for the Electron application. Set the Start method to Monitor All and leave the Path and Target Path blank.
Keep in mind the following limitations:
Automating multiple instances of an Electron application is not supported. Multiple browser windows within the same application instance is supported. The system only injects and automates against a single Electron application.
Electron version 1.7.9 and later are supported. With version 1.7.9, each browser window must load a preload script for injection to work. This limitation does not apply to Electron 2.0.0 and later.
The Electron application must load a package.json file that contains the name of the main script to be launched. Launching packaged Electron applications without this file is not supported. Launching the main script from the Electron command line is not supported.
Windows controls, such as the main menu bar, are not supported.
Context menus are not supported.
Frames in webpages are not supported.
The Navigate methods on the Universal Web Adapter are not supported.
Privacy | Trademarks | Terms of Use | Feedback
Updated: 01 July 2024
© 2016 - 2024 Pegasystems Inc. Cambridge, MA All rights reserved.