3. Record and Run a Test for an Electron Application

Applies to TestComplete 14.80, last modified on May 04, 2021

After a tested Electron application and a TestComplete project are prepared for testing, you can create a test and run it. The easiest way to create a test is to record a sequence of user actions over the application:

  1. If your tested Electron application is running, close it.

  2. To start recording, from the TestComplete main menu, select Test > Record > Record Keyword Test:

    Testing Electron applications tutorial: Start recording
  3. Important: Expand the Recording toolbar, click Run App, and then select your tested Electron application:

    Testing Electron applications tutorial: Run the tested Electron application

    If you run your tested application not from TestComplete, but in any other way (for instance, from the command line), TestComplete will not be able to expose your application internal objects. To test Electron applications, always start them from TestComplete (see the Exposing Electron Applications section in the About Testing Electron Applications topic).

  4. TestComplete will launch the tested application:

    Testing Electron applications tutorial: Application main page
  5. Click anywhere within the main page of the application.

  6. Create a property checkpoint that will verify the text that the application window shows:

    • On the Recording toolbar, click Add Check. In the resulting Checkpoint wizard, click Object property:

      Testing Electron applications tutorial: Call the Checkpoint wizard

      Click the image to enlarge it.

    • Select the Hello World! text on the main page. To select the text, you can –

      Press , drag the target glyph to the text, and then release the mouse button.

      Click , move the mouse pointer to the text, and then press the Select object shortcut (by default, SHIFT+CTRL+A).

      Testing Electron applications tutorial: Select the text to check

      Click the image to enlarge it.

    • On the next page of the wizard, select the contentText property (selected by default):

      Testing Electron applications tutorial: Select the property to check

      Click the image to enlarge it.

    • Click Finish.

  7. Close your tested application and click Stop on the Recording toolbar.

TestComplete will stop the recording and open the recorded test:

Testing Electron applications tutorial: Recorded test

Click the image to enlarge it.

To run the recorded test for your Electron application, click Run on the Keyword Test editor toolbar:

Testing Electron applications tutorial: Run the recorded keyword test

TestComplete will launch your tested application and play back all the recorded user actions. After the test is over, you can view test results:

Testing Electron applications tutorial: View the test results

Where to Go Next

For further information on creating automated tests for web pages, see the following sections:

Prev

See Also

Testing Electron Applications - Tutorial
About Testing Electron Applications

Highlight search results