Preparing Electron Applications for Testing

Applies to TestLeft 4.91, last modified on July 1, 2021

The Electron framework is used to create applications with JavaScript. The user interface of such applications is implemented as web pages that the Chromium web browser embedded into the application renders. With TestLeft, you can create automated tests for applications created with Electron.

Supported Electron Versions

TestLeft can test 32- and 64-bit applications created with Electron version 1.8.2, 2.0.2, 3.0.2, 4.0.2, 5.0.0, 6.0.0, 6.1, 7.0.0, 7.1, 8.0 - 8.5, 9.0 - 9.2, 10.0 - 10.1, 11.0.0.

Note: We do not guarantee that your tests will work with applications created with other versions of Electron.


  • Your tested Electron application must be compiled as a binary executable file. See the Application Distribution section in the Electron documentation.

  • Run your Electron application by using the ApplicationManager.Run method:


    using SmartBear.TestLeft;

    string appPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
    appPath += @"\Orders\app-1.0.0\orders.exe";

    // Runs the Electron-based application

    Visual Basic .NET

    Imports SmartBear.TestLeft

    Dim appPath As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
    appPath = appPath & "\Orders\app-1.0.0\orders.exe"

    ' Runs the Electron-based application Driver.Applications.Run(appPath)


    import com.smartbear.testleft.*;
    import com.smartbear.testleft.testobjects.*;

    String appPath = System.getenv("LOCALAPPDATA");
    appPath += "\\Orders\\app-1.0.0\\orders.exe";

    // Runs the Electron-based application

    If your Electron application is distributed via installable binaries, several executables can be generated upon the installation. In order for the test engine to be able to access the application internals, use the application’s actual executable rather than the application launcher. Typically, the needed executable is located in the %APPDATA%\Local\<Your_App_Name>\app-N.N.N folder.

    To make sure that you use the proper executable, check the Path property of your Electron application process in the TestLeft UI Spy.

Specifics of Testing Electron Applications

  • TestLeft identifies applications created with Electron as the Process test objects rather than the Browser objects.

  • TestLeft recognizes the contents the Chromium web browser renders the same way it recognizes any other web application. Page objects correspond to rendered web pages. Child objects of the Page correspond to web elements on the page. WebView controls in your Electron applications are recognized as Frame objects.

Known Issues

  • If the script injection is restricted by Content Security Policy (CSP) in your tested Electron application, TestLeft will not be able to access internal objects of the application.

  • If you run your tested Electron application created with Electron 9.2.0 x86, from your test, by using the ApplicationManager.Run method, on the Windows 7 operating system, and the sandbox renderer is enabled in the application, the application may fail to render its pages.

See Also

Identifying Web Objects
Preparing CEF-Based Applications for Testing

Highlight search results