TestDriver is designed to work with any desktop application, including Electron, Java, and .NET apps. This guide provides an overview of how to use TestDriver with desktop applications, including installation, configuration, and running tests.

Prerequisites

Before running the tests, ensure you have performed the following steps:

  1. If you haven’t already, signup for a Free Trial on the TestDriver website
  2. Install the TestDriver CLI globally using npm or just follow the VS Code Extension Setup Walkthrough:
npm install -g @testdriverai@beta
  1. Run the init command to set up the TestDriver configuration using the API key you got when you signed up for the trial:
testdriverai init
Now you are ready to run the tests!

Sample test steps

TestDriver in action

Supported desktop applications

TestDriver supports a wide range of desktop applications, including:

  • Electron apps
  • Java apps
  • .NET apps
  • Native Windows applications
  • Native Mac applications
  • Native Linux applications
  • Any other desktop application that can be run on Windows, Mac, or Linux

Installation

To use TestDriver with desktop applications, no special setup is needed. Simply run the local agent to interact with applications on your local machine, or add instructions to prerun.yaml to tell the runner to launch or install the application. Here is an example that performs a calculation on a calculator app:

version: 5.5.5
steps:
  - prompt: launch a calculator
    commands:
      - command: exec
        lang: shell
        linux: |
          linux: |
            jumpapp /usr/bin/galculator > /dev/null 2>&1 &
            exit
        mac: |
          open "/Applications/Calculator.app"
          wait
        windows:
          start /B calc.exe
          timeout /t 5
      - command: wait-for-text
        text: "calculator"
        timeout: 30000

A calculator_test.yaml file might look like this:

version: 5.5.5
steps:
  - prompt: /try performing the operation 2 + 2 = on the calculator that is opened
    commands:
      - command: focus-application
        name: galculator
      - command: hover-image
        description: button with number 2 on the calculator
        action: click
      - command: hover-image
        description: plus button on the calculator
        action: click
      - command: hover-image
        description: button with number 2 on the calculator
        action: click
      - command: hover-image
        description: equals button on the calculator
        action: click

Conclusion

TestDriver is a powerful tool for automating tests for desktop applications. With its support for a wide range of desktop platforms and its easy-to-use interface, you can quickly set up and run tests for your applications. Whether you are testing Electron apps, Java apps, or any other desktop application, TestDriver provides the tools you need to ensure your applications work as expected.